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.
61
questions
0
votes
1
answer
79
views
Is there a faster way to find synonyms for a large list of taxa in R?
I have a list of about ~96,000 species names I need to collect all synonyms for. I have tried the 'taxize' package with the synonyms() function, which outputs the information I need but my list is too ...
0
votes
0
answers
15
views
rgbif search query hangs
I am trying to get all records for a single species from the GBIF database using the rgbif package. My query works fine if I set the number of records to download to something small (limit < 1000). ...
3
votes
1
answer
79
views
How can I add timestamp in osmdata_sf() results?
When I query osm data, I want to receive the timestamp, when some object was added or changed, is it possible to include this data?
There is my query:
q <- opq("London",timeout = 20000) %&...
0
votes
1
answer
42
views
Unable to install the package rmetadata in R
My primary goal is to extract metadata of an article using the title and journal name. To do so, rmetadata package is useful according to the blog https://ropensci.org/blog/2013/03/15/r-metadata/. ...
1
vote
1
answer
167
views
Convert scanned PDF to searcheable PDF (in R)
I'm trying to convert a series of scanned PDF into searchable PDF using the tesseract and pdftools packages. I've accomplished two steps. Now I need to write back to a searchable pdf.
Read scanned ...
2
votes
2
answers
234
views
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 ...
0
votes
2
answers
221
views
Downloading NOAA data
I'm trying to download NOAA data using the rnoaa package and I'm running into a bit of trouble.
I took a vector from a dataframe and it looks like this:
df <- dataframe$ghcnd
Grabbing necessary ...
0
votes
1
answer
60
views
Is there some way to change the characters encoding to its English equivalent IN R?
In R
I am extracting data from Pdf tables using Tabulizer library and the Name are on Nepali language
and after extracting i Get this Table
[1]: https://i.stack.imgur.com/Ltpqv.png
But now i want that ...
3
votes
2
answers
502
views
Is there any R function to extract all taxonomy name (phylum, class, order, family ...) from species taxonomic ID/ species name or genus name?
I have the taxonomic ID of species and I can get the species and genus name from NCBI (https://www.ncbi.nlm.nih.gov/Taxonomy/TaxIdentifier/tax_identifier.cgi). But I want phylum, class, order.. all ...
1
vote
1
answer
72
views
Return only non-missing values from osm search
I'm trying to just get non-na values returned from osmdata. For example, take email address. However, the below returns mostly missing emails. How can I set up the query so that it returns only non-...
1
vote
1
answer
119
views
Why does textreuse packge in R make LSH buckets way larger than the original minhashes?
As far as I understand one of the main functions of the LSH method is data reduction even beyond the underlying hashes (often minhashes). I have been using the textreuse package in R, and I am ...
1
vote
2
answers
1k
views
Extract count of intersections for Open Street Map way IDs, by route type
Edited with additional details added
I have a shapefile of 2,061 Open Street Map (OSM) road segments. Each segment in my shapefile is is identified by its OSM Way ID.
Here is an example of five ...
0
votes
0
answers
644
views
'qualtRics' R package API call returns "port 443: Connection refused". What am I missing?
Good afternoon!
I'm a self-taught R developer so I might not be using the correct jargon, but please bear with me.
I have written a script to clean and process data which has been manually exported ...
0
votes
0
answers
246
views
Customizing {drake} plan with {data.table}
My goal is to customize {drake} plan to reduce duplication of codes for both simple and complex cases, for example, setting drake::trigger for multiple targets based on specific conditions of the ...
0
votes
1
answer
270
views
How to create a plan target to cross over the results of previous map targets and a new variable?
From multiple target (a) created with map I have 2 other targets (b and d) that iterate over the first target. Now I would like to use the results of these targets in another target. In addition I ...
2
votes
2
answers
504
views
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 ...
0
votes
1
answer
251
views
Wait for rgbif download to complete before proceeding
I am developing a small application in R Shiny. Part of the application will need to query GBIF to download species occurrence data. This is possible using rgbif. The function rgbif::occ_download() ...
3
votes
1
answer
240
views
drake - map over ggplot targets to output them
First off, drake is just magical. I love the workflow of designing the dependency graph, and then executing it in one fell swoop.
However, I ran into a roadblock.
My workflow is simulating over ...
6
votes
0
answers
139
views
Lock environment but not .Random.seed
Is it possible to lock the global environment and still allow .Random.seed to be set or removed? The default behavior of lockEnvironment() is too aggressive
for my use case.
lockEnvironment(globalenv(...
7
votes
1
answer
220
views
subcomponent(mode = "in") for multiple source vertices
Question
In the igraph R package, is there an efficient implementation of subcomponent() and/or BFS that can handle multiple source vertices?
Motivation
The drake R package models a user's workflow ...
3
votes
2
answers
1k
views
Launch RSelenium Browser regardless of port open/closed
Question: Is there a function that will open a selenium browser if none is already open, or close the current browser and reset the port and relaunch a browser?
Rationale: I work with big loops in ...
1
vote
1
answer
74
views
Halting drake plan makes it rebuild targets it already had built previously
I'm currently using drake to run a set of >1k simulations. I've estimated that it would take about two days to run the complete set, but I also expect my computer to crash at any point during that ...
0
votes
1
answer
156
views
Passing a variable in a solr auery
I'm working with solr using r library solrium
After the connection to solr in the variable conn1, I make queries like this:
solr_search(conn1,"collection_name", params = list(q = "price:1000",...
2
votes
1
answer
556
views
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, ...
0
votes
1
answer
146
views
linking functions with purrr and referencing nested variables
I'm scraping data from a large online database (GBIF), which requires three steps: (1) match a GBIF "key" identifier to a species name, (2) send a query to the database, getting a download key ("res") ...
0
votes
0
answers
59
views
Error using elastic on linux server but no error on windows
When I execute
elastic::Search(index=index,body=body,size=1000,scroll="3m")
on a linux server I receive the following error.
invalid char in json text. <!DOCTYPE HTML PUBLIC "-//W3C//
On ...
0
votes
0
answers
84
views
Elastic with_position_offsets
I get an error when I execute the following body in elastic in R.
{"stored_fields": ["CONTENT.LENGTH"],
"_source":["DOC_ID", "DELIVERY_ID", "SRC_SYSTEM", "CONVERS_ID", "CONTRIB_ID"...
6
votes
3
answers
2k
views
Subsetting geojson data with R
I have a geojson file of state boundaries that I obtained from here. In particular I'm using the 20m US States Data
I'm trying to subset the data so that I can use leaflet to map only certain states. ...
1
vote
1
answer
444
views
how to index data using index_create() in elastic package in R
This is my code in R to index iris data.
library(elastic)
iris<-datasets::iris
body <- list(data = list(iris))
index_create(index = 'iris',body = body)
but it gives the following error.
...
0
votes
0
answers
83
views
Create, validate and compare data schema (for data harvest) in ckanr
This is a data harvest exercise. The code below ingests data as JSON. I would like to (a) print/extract the data schema from this data into Schema1. Then (b) compare it against some Schema2, because I ...
2
votes
1
answer
2k
views
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)
...
4
votes
2
answers
2k
views
R Shiny error: How to work with the click events incase of two plotly plots?
I have two plotly plots in a shiny dashboard. When I click on the first plotly plot, the interactive event is working fine. But when I perform the same operation on the second plot which is a stacked ...
2
votes
2
answers
976
views
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(...
1
vote
1
answer
394
views
automate input to user query in R
I apologize if this question has been asked with terminology I don't recognize but it doesn't appear to be.
I am using the function comm2sci in the library taxize to search for the scientific names ...
3
votes
0
answers
197
views
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 ...
1
vote
0
answers
33
views
rCan't connect to Spigot server using ropenscilabs miner package
I would like to try out the miner Minecraft API from ROpenSci and am having trouble connecting to the server from R. I am sure this is a networking issue rather than a R or Minecraft issue but I don't ...
11
votes
2
answers
10k
views
dynamically adjust height and/or width of shiny-plotly output based on window size
I would like to have the shiny-plotly output height and width adjusted to the current window size. I have tried to use the below but of no use.
ShinyUi <- fluidPage(
# Application title
...
1
vote
1
answer
1k
views
How to download NY state all County data in R for leaflet map
# From http://eric.clst.org/Stuff/USGeoJSON and
# https://en.wikipedia.org/wiki/List_of_United_States_counties_and_county_equivalents
nycounties <- geojsonio::geojson_read("json/nycounties.geojson",...
4
votes
1
answer
2k
views
How to download geojson data and read it to R
# From http://leafletjs.com/examples/choropleth/us-states.js
states <- geojsonio::geojson_read("json/us-states.geojson", what = "sp")
bins <- c(0, 10, 20, 50, 100, 200, 500, 1000, Inf)
pal <-...
1
vote
2
answers
596
views
Parsing XML file in R using rentrez
I am not an XML expert. I am having an issue when parsing XML file using rentrez. I am trying to have author and affiliation by each pmid (article id in PubMed database) as an output. I have code that ...
1
vote
1
answer
577
views
PubMed XML parsing using entrez_fetch in rentrez
I am collecting author's information and article information for a search term in PubMed. I am getting author name, publication year and other information successfully using entrez_fetch in rentrez ...
0
votes
0
answers
75
views
Memory Issues using rnoaa package
Working with rnoaa package to take add US station IDs to a df of weather events. Below is str() for the rain df.
google drive link to csv file of subset
'data.frame': 4395 obs. of 63 variables:
$...
1
vote
1
answer
385
views
How to obtain files included in initial commit using git2r (libgit2)?
I am using the R package git2r to interface with libgit2. I would like to obtain the list of files that were updated in each commit, similar to the output from git log --stat or git log --name-only. ...
1
vote
1
answer
456
views
Convert data to geojson error
I am trying to use the geojsonio package to write some geojson files from data.frames pulled from some other R packages.
library(ggplot2)
library(geojsonio)
us_state <- map_data('state')
...
1
vote
1
answer
3k
views
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 ...
2
votes
1
answer
443
views
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 ...
2
votes
1
answer
893
views
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 ...
6
votes
1
answer
2k
views
ACM Digital Library access with R - No API so how possible?
I want to search ACM Digital library using R code, retrieving at least metadata including abstracts, and at best the full text.
I know that the rOpenSci libraries provide R packages and functions to ...
1
vote
0
answers
688
views
R: rgdal writing GeoJSON
I'm having a problem with rgdal which drops the projection information when writing geoJSON files.
library(rgdal)
inputJSON<- readOGR("test.geojson", "OGRGeoJSON") # works!
If i type summary(...
7
votes
3
answers
2k
views
Convert features of a 'multifeature' GeoJSON into R spatial objects
Normally you can read geojson files into R with trusty readOGR, as illustrated here.
However, this fails for multifeature geojsons.
Reproducible example:
downloader::download("https://github.com/...