Questions tagged [ropensci]

R packages created by the organization R Open Science (rOpenSci for short) that interact with scientific data repositories, journals, and providers of scientific metrics.

We develop open source R packages that provide programmatic access to a variety of scientific data, full-text of journal articles, and repositories that provide real-time metrics of scholarly impact. Visit our packages section for a full list of production and development versions of packages.

63 questions
3
votes
0 answers

R: adjusting legend labels to the selected (gg)plotly output

I am using ggplotly object to visualize a scatterplot in a shiny dashboard. I have a plot colored using the values of a column. However, when I want to look at a certain part of the plot, I zoom in to know more about the points. Then the legend…
Prradep
  • 5,506
  • 5
  • 43
  • 84
3
votes
2 answers

How to load *part* of a multifeature geojson file in R?

I have a geojson that is a FeatureCollection containing 2 geographic data types: a LineString and a waypoint - see the raw file here - this is how it looks on GitHub: I want to load only only the LineString, so this is what I do: library(RCurl) obj…
RobinLovelace
  • 4,799
  • 6
  • 29
  • 40
2
votes
2 answers

How to use rgbif to download occurrence data from multiple polygons at once?

I am trying to download occurrence data of multiple taxonomic groups from multiple regions using the R package rgbif. I prefer to have one download by combining all the regions together (because I have thousands of regions, it would be insane to…
Daijiang Li
  • 697
  • 4
  • 16
2
votes
2 answers

Faster way to slice a (raw) vector?

Problem I am looking for a fast (ideally constant-time) way to take a large slice a long raw vector in R. For example: obj <- raw(2^32) obj[seq_len(2^31 - 1)] Even with ALTREP, base R takes too long. system.time(obj[seq_len(2^31 - 1)]) #> user …
landau
  • 5,636
  • 1
  • 22
  • 50
2
votes
1 answer

R drake file out name with variable

I am using drake to create multiple output files, where I want to specify the path by a variable. Something like outpath <- "data" outfile <- file.path(outpath, "mydata.csv") write.csv(df, outfile) But file_out doesn't seem to work with arguments…
David
  • 9,216
  • 4
  • 45
  • 78
2
votes
1 answer

Shiny update the clicked point to highlight it

Here is a working example of extracting the on-click event. I would like to ask you if there is a way to update the clicked point with either increase in size or highlight it etc.,? library(shiny) library(plotly) ui <- fluidPage( …
Prradep
  • 5,506
  • 5
  • 43
  • 84
2
votes
2 answers

Shiny error while using nearPoints in renderPlotly click event

I would like to fetch nearPoints using the data from a click event. I have found the below snippet from the Shiny webpage and it works fine as expected. output$plot <- renderPlot({ d <- data() plot(d$speed, d$dist) }) output$plot_clickedpoints…
Prradep
  • 5,506
  • 5
  • 43
  • 84
2
votes
1 answer

Connect to Secured Elastic Search with self-signed certificate from elastic R package

I am running an Elastic Search instance with SSL by creating a self-signed certificate. I ran into a problem when connecting from R through elastic package. This is how I progressed: After enabling SSL, when I tried to connect to the Elastic Search…
Sonny
  • 3,083
  • 1
  • 11
  • 19
2
votes
1 answer

Secured Elastic Search R connection Error - Client requested protocal TLSv1 not enabled or not supported

I use the elastic 0.7.8 R package to connect to my Elastic Search instance. Recently, I tried to secure the Elastic Search by using Search Guard 2. Everything work fines after securing it. But when I try to connect from R, it…
Sonny
  • 3,083
  • 1
  • 11
  • 19
2
votes
1 answer

Write data frame to Elastic Search with @timestamp

I am exploring the elastic R package to write a data frame to ElasticSearch. I am using docs_bulk function. One of the columns in my dataframe is @timestamp which is in POSIXct format. But the field is getting saved in Elastic Search as string. Any…
Sonny
  • 3,083
  • 1
  • 11
  • 19
2
votes
1 answer

What to do when a NOAA ERDDAP dataset is not found?

I'm trying to download some gridded ERDDAP data using the rnoaa package in R. While the data retrieval works perfectly for some datasets, I'm having some problems getting the data for some datasets in particular. For example when I run: library…
2
votes
2 answers

Using 2+ legends from R to plotly / plot.ly

I am using R's ggplot to create a static plot and pass that on to plot.ly to create an interactive plot. My aim to project a categorical variable to the color and a numeric variable to size. With R's [iris] data that works perfect - Like…
Sylvia
  • 315
  • 2
  • 17
2
votes
1 answer

Proxies and httr vs RCurl

Has anyone heard of problems using RCurl vs. httr when the user is using a proxy? I have this package taxize in which some functions use RCurl and some use httr. A user reports two functions that don't require her to pass in proxy details, and…
sckott
  • 5,755
  • 2
  • 26
  • 42
1
vote
2 answers

Targets dynamic branching to add columns to matrix

I have multiple rasters in a R targets pipeline that I load with tar_files() and then iterate over it in the next target to add one column per file to a matrix. However, only the first column is created. Here is a reprex without using…
Josep Pueyo
  • 387
  • 2
  • 11
1
vote
1 answer

Fetching altmetric data using R

Why the following code repeatedly gives me an error? library(rcrossref) library(rAltmetric) alt <- altmetrics(doi = '10.1111/j.1475-2743.2006.00029.x') Error: lexical error: invalid char in json text. The API…
iGada
  • 599
  • 3
  • 9