ropensci / rnoaa

R interface to many NOAA data APIs
https://docs.ropensci.org/rnoaa
Other
330 stars 84 forks source link

Error in strsplit when fetching data #232

Closed andypicke closed 7 years ago

andypicke commented 7 years ago

When I run the following code to retrieve data

monthly <- ncdc(datasetid='GSOM', stationid= "GHCND:USC00084289", startdate="2014-11-01", enddate="2017-11-01", limit=1000)

I get the error message

Error in strsplit(y, ",") : non-character argument

sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rjson_0.2.15 RODBCext_0.3.1 MASS_7.3-47 lubridate_1.6.0 dplyr_0.7.3 rnoaa_0.7.0 boot_1.3-19 stringr_1.2.0
[9] gplots_3.0.1 RODBC_1.3-15

loaded via a namespace (and not attached): [1] Rcpp_0.12.12 compiler_3.4.1 plyr_1.8.4 bindr_0.1 bitops_1.0-6 tools_3.4.1
[7] digest_0.6.12 jsonlite_1.5 tibble_1.3.4 gtable_0.2.0 pkgconfig_2.0.1 rlang_0.1.2
[13] curl_2.8.1 bindrcpp_0.2 gridExtra_2.3 knitr_1.17 xml2_1.1.1 httr_1.3.1
[19] gtools_3.5.0 caTools_1.17.1 rappdirs_0.3.1 grid_3.4.1 glue_1.1.1 R6_2.2.2
[25] XML_3.98-1.9 gdata_2.18.0 hoardr_0.2.0 ggplot2_2.2.1 tidyr_0.7.1 purrr_0.2.3
[31] magrittr_1.5 scales_0.5.0 assertthat_0.2.0 colorspace_1.3-2 KernSmooth_2.23-15 stringi_1.1.5
[37] lazyeval_0.2.0 munsell_0.4.3

sckott commented 7 years ago

thx @andypicke

i get same and traceback gives

#> 5: strsplit(y, ",")
#> 4: parse_ncdc(x, fun = gsom_mapper)
#> 3: FUN(X[[i]], ...)
#> 2: lapply(tt$results, split_atts, ds = datasetid)
#> 1: ncdc(datasetid = "GSOM", stationid = "GHCND:USC00084289", startdate = "2014-11-01",
#>        enddate = "2017-11-01", limit = 1000)

looks like problem in internal fxn parse_ncdc

sckott commented 7 years ago

@andypicke reinstall devtools::install_github("ropensci/rnoaa") and trya gain

andypicke commented 7 years ago

Thanks, that works now.

On Fri, Sep 22, 2017 at 2:31 PM, Scott Chamberlain <notifications@github.com

wrote:

@andypicke https://github.com/andypicke reinstall devtools::install_github("ropensci/rnoaa") and trya gain

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/232#issuecomment-331553153, or mute the thread https://github.com/notifications/unsubscribe-auth/AG6El8LDiHZEwtgEbx2hLDW8I1sqZv05ks5slBkcgaJpZM4Pg3wT .

-- Andy Pickering andypicke@gmail.com Linkedin https://www.linkedin.com/in/andypicke/ Github https://github.com/andypicke https://andypicke.github.io/