ropensci / rdatacite

Wrapper to DataCite metadata
https://docs.ropensci.org/rdatacite
Other
25 stars 3 forks source link

rows = 10000 should not convert to 1e+5 #15

Closed benmarwick closed 6 years ago

benmarwick commented 6 years ago

When I run:

dc_arch <- dc_search(q = "archaeology", rows = 100000)

I get:

https://search.datacite.org/api?q=archaeology&rows=1e+05&wt=json
Error: 500 - For input string: "1e+05"

But when I use this URL in my browser: https://search.datacite.org/api?q=archaeology&rows=100000&wt=json I appear to get a valid response.

So is it possible to protect large numbers to prevent the dc_* functions from getting a URL with exponential notation? I'm currently doing this, which seems to work:

dc_arch <- dc_search(q = "archaeology", rows = pretty(100000)[2])

But maybe there's a better way? Thanks!

sckott commented 6 years ago

thanks @benmarwick

yep, need to make sure sci notation monster doesn't eat up large numbers - have done this in other pkgs, will have a look and see how i've done it before

sckott commented 6 years ago

@benmarwick try reinstalling - fix in solrium - devtools::install_github("ropensci/rdatacite") - which will pull in newer solrium

benmarwick commented 6 years ago

Yes, thanks very much, that's fixed it!

sckott commented 6 years ago

great, glad it worked