ropensci / rnoaa

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

ghcnd_stations() returns empty tibble #305

Closed mayhaw closed 5 years ago

mayhaw commented 5 years ago

Looks like maybe something is up with the daily database due to a recent revamp:

April 19, 2019 On April 20, 2019 GHCNd version 3.26 will be released. Version 3.26 contains approximately 5000 new stations for Mexico. The new station data are identified with the data source code (SFLAG) 'm' and the total number of values in GHCNd will increase by about 150 million with the this new source of Mexican data.

When I try to create a object with the station id's etc with... station_data <- ghcnd_stations() I get an empty tibble that looks like this:


station_data
# A tibble: 0 x 11
# ... with 11 variables: id <lgl>, latitude <lgl>, longitude <lgl>, elevation <lgl>, state <lgl>, name <lgl>,
#   gsn_flag <lgl>, wmo_id <lgl>, element <chr>, first_year <int>, last_year <int>
Do I just need to be more patient or is the new version causing issues with the function? This worked for me a 3 or 4 weeks ago last time I used it. Thanks!

<!-- IF THIS INVOLVES AUTHENTICATION: DO NOT SHARE YOUR USERNAME/PASSWORD, OR API KEYS/TOKENS IN THIS ISSUE - MOST LIKELY THE MAINTAINER WILL HAVE THEIR OWN EQUIVALENT KEY -->

<!-- If this issue relates to usage of the package, whether a question, bug or similar, along with your query, please paste your devtools::session_info() or sessionInfo() into the code block below, AND include a reproducible example (consider using a "reprex" https://cran.rstudio.com/web/packages/reprex/) If not, delete all this and proceed :) -->

<details> <summary><strong>Session Info</strong></summary>
> session_info()
- Session info -------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       Windows >= 8 x64            
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       America/New_York            
 date     2019-04-22                  

- Packages -----------------------------------------------------------------------------------------------------
 ! package          * version   date       lib source        
   abind              1.4-5     2016-07-21 [1] CRAN (R 3.5.2)
   acepack            1.4.1     2016-10-29 [1] CRAN (R 3.5.1)
   assertthat         0.2.0     2017-04-11 [1] CRAN (R 3.5.1)
   backports          1.1.2     2017-12-13 [1] CRAN (R 3.5.0)
   base64enc          0.1-3     2015-07-28 [1] CRAN (R 3.5.0)
   bindr              0.1.1     2018-03-13 [1] CRAN (R 3.5.1)
   bindrcpp           0.2.2     2018-03-29 [1] CRAN (R 3.5.1)
   boot             * 1.3-20    2017-08-06 [2] CRAN (R 3.5.1)
   broom            * 0.5.1     2018-12-05 [1] CRAN (R 3.5.1)
   callr              3.1.0     2018-12-10 [1] CRAN (R 3.5.1)
   car              * 3.0-2     2018-08-23 [1] CRAN (R 3.5.3)
   carData          * 3.0-2     2018-09-30 [1] CRAN (R 3.5.2)
   cellranger         1.1.0     2016-07-27 [1] CRAN (R 3.5.1)
   checkmate          1.8.5     2017-10-24 [1] CRAN (R 3.5.1)
   chron            * 2.3-53    2018-09-09 [1] CRAN (R 3.5.2)
   cli                1.0.1     2018-09-25 [1] CRAN (R 3.5.1)
   cluster            2.0.7-1   2018-04-13 [2] CRAN (R 3.5.1)
   codetools          0.2-15    2016-10-05 [2] CRAN (R 3.5.1)
   colorspace         1.3-2     2016-12-14 [1] CRAN (R 3.5.1)
   crayon             1.3.4     2017-09-16 [1] CRAN (R 3.5.1)
   crosstalk          1.0.0     2016-12-21 [1] CRAN (R 3.5.1)
   crul               0.6.0     2018-07-10 [1] CRAN (R 3.5.1)
   curl               3.2       2018-03-28 [1] CRAN (R 3.5.1)
   data.table       * 1.11.8    2018-09-30 [1] CRAN (R 3.5.1)
   DEoptimR           1.0-8     2016-11-19 [1] CRAN (R 3.5.2)
   desc               1.2.0     2018-05-01 [1] CRAN (R 3.5.1)
   devtools         * 2.0.1     2018-10-26 [1] CRAN (R 3.5.1)
   digest             0.6.18    2018-10-10 [1] CRAN (R 3.5.1)
   dismo            * 1.1-4     2017-01-09 [1] CRAN (R 3.5.1)
   dplyr            * 0.7.8     2018-11-10 [1] CRAN (R 3.5.1)
   emmeans            1.3.2     2019-01-22 [1] CRAN (R 3.5.2)
   EMSaov           * 2.3       2018-05-09 [1] CRAN (R 3.5.3)
   estimability       1.3       2018-02-11 [1] CRAN (R 3.5.2)
   fansi              0.4.0     2018-10-05 [1] CRAN (R 3.5.1)
   forcats            0.3.0     2018-02-19 [1] CRAN (R 3.5.1)
   foreign            0.8-70    2017-11-28 [2] CRAN (R 3.5.1)
   Formula          * 1.2-3     2018-05-03 [1] CRAN (R 3.5.0)
   fs                 1.2.6     2018-08-23 [1] CRAN (R 3.5.1)
   gcookbook        * 2.0       2018-11-07 [1] CRAN (R 3.5.2)
   gdata            * 2.18.0    2017-06-06 [1] CRAN (R 3.5.1)
   generics           0.0.2     2018-11-29 [1] CRAN (R 3.5.1)
   ggplot2          * 3.1.0     2018-10-25 [1] CRAN (R 3.5.1)
   glue               1.3.0     2018-07-17 [1] CRAN (R 3.5.1)
   gridExtra          2.3       2017-09-09 [1] CRAN (R 3.5.1)
   gtable             0.2.0     2016-02-26 [1] CRAN (R 3.5.1)
   gtools             3.8.1     2018-06-26 [1] CRAN (R 3.5.0)
   haven              2.0.0     2018-11-22 [1] CRAN (R 3.5.1)
   Hmisc            * 4.1-1     2018-01-03 [1] CRAN (R 3.5.1)
   hms                0.4.2     2018-03-10 [1] CRAN (R 3.5.1)
   hoardr             0.5.2     2018-12-02 [1] CRAN (R 3.5.1)
   htmlTable          1.12      2018-05-26 [1] CRAN (R 3.5.1)
   htmltools          0.3.6     2017-04-28 [1] CRAN (R 3.5.1)
   htmlwidgets        1.3       2018-09-30 [1] CRAN (R 3.5.1)
   httpcode           0.2.0     2016-11-14 [1] CRAN (R 3.5.0)
   httpuv             1.4.5     2018-07-19 [1] CRAN (R 3.5.1)
   httr               1.4.0     2018-12-11 [1] CRAN (R 3.5.1)
   jomo               2.6-5     2018-11-09 [1] CRAN (R 3.5.1)
   jsonlite           1.5       2017-06-01 [1] CRAN (R 3.5.1)
   knitr              1.21      2018-12-10 [1] CRAN (R 3.5.1)
   labeling           0.3       2014-08-23 [1] CRAN (R 3.5.0)
   later              0.7.5     2018-09-18 [1] CRAN (R 3.5.1)
   lattice          * 0.20-35   2017-03-25 [2] CRAN (R 3.5.1)
   latticeExtra       0.6-28    2016-02-09 [1] CRAN (R 3.5.1)
   lazyeval           0.2.1     2017-10-29 [1] CRAN (R 3.5.1)
   leaflet          * 2.0.2     2018-08-27 [1] CRAN (R 3.5.1)
   leaps            * 3.0       2017-01-10 [1] CRAN (R 3.5.2)
   lme4             * 1.1-19    2018-11-10 [1] CRAN (R 3.5.1)
   lubridate        * 1.7.4     2018-04-11 [1] CRAN (R 3.5.2)
   magrittr         * 1.5       2014-11-22 [1] CRAN (R 3.5.1)
   manipulateWidget   0.10.0    2018-06-11 [1] CRAN (R 3.5.1)
   maptools         * 0.9-4     2018-09-19 [1] CRAN (R 3.5.1)
   MASS             * 7.3-50    2018-04-30 [2] CRAN (R 3.5.1)
   Matrix           * 1.2-14    2018-04-13 [2] CRAN (R 3.5.1)
   memoise            1.1.0     2017-04-21 [1] CRAN (R 3.5.1)
   metafor          * 2.0-0     2017-06-22 [1] CRAN (R 3.5.1)
   mice             * 3.3.0     2018-07-27 [1] CRAN (R 3.5.1)
   mime               0.6       2018-10-05 [1] CRAN (R 3.5.1)
   miniUI             0.1.1.1   2018-05-18 [1] CRAN (R 3.5.1)
   minqa              1.2.4     2014-10-09 [1] CRAN (R 3.5.1)
   mitml              0.3-6     2018-07-10 [1] CRAN (R 3.5.1)
   munsell            0.5.0     2018-06-12 [1] CRAN (R 3.5.1)
   mvtnorm            1.0-8     2018-05-31 [1] CRAN (R 3.5.2)
   nlme             * 3.1-137   2018-04-07 [1] CRAN (R 3.5.1)
   nloptr             1.2.1     2018-10-03 [1] CRAN (R 3.5.1)
   nnet               7.3-12    2016-02-02 [2] CRAN (R 3.5.1)
   openxlsx           4.1.0     2018-05-26 [1] CRAN (R 3.5.3)
   pan                1.6       2018-06-29 [1] CRAN (R 3.5.1)
   pillar             1.3.0     2018-07-14 [1] CRAN (R 3.5.1)
   pkgbuild           1.0.2     2018-10-16 [1] CRAN (R 3.5.1)
   pkgconfig          2.0.2     2018-08-16 [1] CRAN (R 3.5.1)
   pkgload            1.0.2     2018-10-29 [1] CRAN (R 3.5.1)
   plotly           * 4.8.0     2018-07-20 [1] CRAN (R 3.5.2)
   plyr             * 1.8.4     2016-06-08 [1] CRAN (R 3.5.1)
   prettyunits        1.0.2     2015-07-13 [1] CRAN (R 3.5.1)
   processx           3.2.1     2018-12-05 [1] CRAN (R 3.5.1)
   promises           1.0.1     2018-04-13 [1] CRAN (R 3.5.1)
   ps                 1.2.1     2018-11-06 [1] CRAN (R 3.5.1)
   purrr              0.2.5     2018-05-29 [1] CRAN (R 3.5.1)
   R6                 2.3.0     2018-10-04 [1] CRAN (R 3.5.1)
   rappdirs           0.3.1     2016-03-28 [1] CRAN (R 3.5.1)
   raster           * 2.8-4     2018-11-03 [1] CRAN (R 3.5.2)
   RColorBrewer       1.1-2     2014-12-07 [1] CRAN (R 3.5.0)
   Rcpp               1.0.0     2018-11-07 [1] CRAN (R 3.5.1)
   readr            * 1.2.1     2018-11-22 [1] CRAN (R 3.5.1)
   readxl           * 1.1.0     2018-04-20 [1] CRAN (R 3.5.1)
   rematch            1.0.1     2016-04-21 [1] CRAN (R 3.5.1)
   remotes            2.0.2     2018-10-30 [1] CRAN (R 3.5.1)
   reshape          * 0.8.8     2018-10-23 [1] CRAN (R 3.5.1)
   rgdal            * 1.3-6     2018-10-16 [1] CRAN (R 3.5.1)
   rgl              * 0.99.16   2018-03-28 [1] CRAN (R 3.5.1)
   rio                0.5.16    2018-11-26 [1] CRAN (R 3.5.3)
 D rJava              0.9-10    2018-05-29 [1] CRAN (R 3.5.2)
   rlang              0.3.0.1   2018-10-25 [1] CRAN (R 3.5.1)
   rnoaa            * 0.8.0     2018-12-03 [1] CRAN (R 3.5.1)
   robfilter        * 4.1.1     2018-05-17 [1] CRAN (R 3.5.2)
   robustbase       * 0.93-3    2018-09-21 [1] CRAN (R 3.5.2)
   rpart              4.1-13    2018-02-23 [2] CRAN (R 3.5.1)
   rprojroot          1.3-2     2018-01-03 [1] CRAN (R 3.5.1)
   rsm              * 2.10      2018-09-02 [1] CRAN (R 3.5.2)
   rstudioapi         0.8       2018-10-02 [1] CRAN (R 3.5.1)
   scales             1.0.0     2018-08-09 [1] CRAN (R 3.5.1)
   sessioninfo        1.1.1     2018-11-05 [1] CRAN (R 3.5.1)
   shiny              1.2.0     2018-11-02 [1] CRAN (R 3.5.1)
   sp               * 1.3-1     2018-06-05 [1] CRAN (R 3.5.1)
   splitstackshape  * 1.4.6     2018-07-23 [1] CRAN (R 3.5.1)
   stringi            1.2.4     2018-07-20 [1] CRAN (R 3.5.1)
   stringr            1.4.0     2019-02-10 [1] CRAN (R 3.5.3)
   survival         * 2.42-3    2018-04-16 [2] CRAN (R 3.5.1)
   testthat           2.0.1     2018-10-13 [1] CRAN (R 3.5.2)
   tibble             1.4.2     2018-01-22 [1] CRAN (R 3.5.1)
   tidyr            * 0.8.2     2018-10-28 [1] CRAN (R 3.5.2)
   tidyselect         0.2.5     2018-10-11 [1] CRAN (R 3.5.1)
   triebeard          0.3.0     2016-08-04 [1] CRAN (R 3.5.1)
   urltools           1.7.1     2018-08-03 [1] CRAN (R 3.5.1)
   usethis          * 1.4.0     2018-08-14 [1] CRAN (R 3.5.1)
   utf8               1.1.4     2018-05-24 [1] CRAN (R 3.5.1)
   viridisLite        0.3.0     2018-02-01 [1] CRAN (R 3.5.1)
   webshot            0.5.1     2018-09-28 [1] CRAN (R 3.5.1)
   weights          * 1.0       2018-10-16 [1] CRAN (R 3.5.1)
   withr              2.1.2     2018-03-15 [1] CRAN (R 3.5.1)
   xfun               0.4       2018-10-23 [1] CRAN (R 3.5.1)
   XLConnect        * 0.2-15    2018-04-05 [1] CRAN (R 3.5.3)
   XLConnectJars    * 0.2-15    2018-04-05 [1] CRAN (R 3.5.2)
   xlsx               0.6.1     2018-06-11 [1] CRAN (R 3.5.2)
   xlsxjars           0.6.1     2014-08-22 [1] CRAN (R 3.5.2)
   XML                3.98-1.16 2018-08-19 [1] CRAN (R 3.5.1)
   xml2               1.2.0     2018-01-24 [1] CRAN (R 3.5.1)
   xtable             1.8-3     2018-08-29 [1] CRAN (R 3.5.1)
   xts              * 0.11-2    2018-11-05 [1] CRAN (R 3.5.1)
   zip                2.0.1     2019-03-11 [1] CRAN (R 3.5.3)
   zoo              * 1.8-4     2018-09-19 [1] CRAN (R 3.5.1)

[1] C:/Users/seanb/Documents/R/win-library/3.5
[2] C:/Program Files/R/R-3.5.1/library

 D -- DLL MD5 mismatch, broken installation.
>

```r

sckott commented 5 years ago

thanks, can you include your R session info please

mayhaw commented 5 years ago

Ok i added session info

sckott commented 5 years ago

Sorry for the delay in answering, had some family stuff that came up. Looking at this today

sckott commented 5 years ago

I can't replicate the problem, with the current CRAN version, the older CRAN version you have, or the development version here on github.

It's worth trying to upgrade to the latest CRAN version at least to see if that fixes things.

It's possible some dependency version is to blame here. e.g., maybe tibble, which is used in this fxn, you've got a relatively old version of that pkg

chanse-ford commented 5 years ago

I've also been encountering this problem. I was just pulling data using the ghcnd_stations() function last week, but suddenly the code no longer pulls anything.

`stations <- ghcnd_stations() stations A tibble: 0 x 11 ... with 11 variables: id , latitude , longitude , elevation , state , name , gsn_flag , wmo_id , element , first_year , last_year

sessionInfo() R version 3.3.0 (2016-05-03) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

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] raster_2.6-7 rgdal_1.2-18 sp_1.2-7 rnoaa_0.8.4 isdparser_0.3.0 tibble_1.4.2 gridExtra_2.3 rappdirs_0.3.1 [9] jsonlite_1.5 xml2_1.2.0 XML_3.98-1.11 scales_0.5.0 ggplot2_3.1.1 tidyr_0.8.0 dplyr_0.7.4 lubridate_1.7.4 [17] httr_1.4.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.1 pillar_1.3.1 plyr_1.8.4 bindr_0.1.1 tools_3.3.0 digest_0.6.14 evaluate_0.13
[8] lattice_0.20-33 gtable_0.3.0 pkgconfig_2.0.2 rlang_0.3.4.9003 rstudioapi_0.10 yaml_2.1.18 crul_0.7.4
[15] curl_3.3 xfun_0.6 bindrcpp_0.2.2 knitr_1.22 withr_2.1.2 stringr_1.4.0 triebeard_0.3.0 [22] grid_3.3.0 httpcode_0.2.0 glue_1.3.1 R6_2.4.0 fansi_0.4.0 rmarkdown_1.12 hoardr_0.5.2
[29] purrr_0.2.4 magrittr_1.5 htmltools_0.3.6 urltools_1.7.3 assertthat_0.2.1 colorspace_1.3-2 utf8_1.1.3
[36] stringi_1.1.7 lazyeval_0.2.1 munsell_0.5.0 crayon_1.3.4 `

sckott commented 5 years ago

thanks for the ping here @chanse-ford You do have a very old version of R from 2016, I don't know if that's to blame, but it wouldn't hurt to upgrade to the current R version (v3.6).

both empty data.frame's come from windows machines, so it may be a windows problem, will investigate that

sckott commented 5 years ago

@mayhaw @chanse-ford reinstall remotes::install_github("ropensci/rnoaa"), reload R, then try again, let me know if it works now

chanse-ford commented 5 years ago

@sckott I've updated R to 3.6 and installed the github version of the package you linked and everything appears to be working normally again on my machine. Thanks for figuring this out so quickly.

sckott commented 5 years ago

glad it works

mayhaw commented 5 years ago

installing R 3.6 and install.packages("rnoaa") worked for me

sckott commented 5 years ago

@mayhaw glad it works