ropensci / rnoaa

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

new ncdc() error in v0.8 #293

Closed ghaines3 closed 5 years ago

ghaines3 commented 5 years ago

Hi Scott, I'm getting this error from ncdc() with the new version.

station_data <- ghcnd_stations()
lat_lon_df <- data.frame(id = c("sydney", "brisbane"),
                         latitude = c(-33.8675, -27.4710),
                         longitude = c(151.2070, 153.0234))
x <-  meteo_nearby_stations(lat_lon_df = lat_lon_df,
                            station_data = station_data, radius = 10)
res <- ncdc(datasetid = "GSOY", stationid = paste0('GHCND:', x$brisbane$id), 
            startdate = "2008-01-01", enddate = "2017-12-31", datatypeid="PRCP", 
            limit = 10, token = "_______")

Error: x$response_headers$`content-type` == "application/json;charset=UTF-8" is not TRUE

Thanks very much

Session Info ```r > sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] bindrcpp_0.2.2 memisc_0.99.14.12 MASS_7.3-51.1 lattice_0.20-38 [5] data.table_1.11.8 plyr_1.8.4 rnoaa_0.8.0 geosphere_1.5-7 [9] rlist_0.4.6.1 tidyr_0.8.2 loaded via a namespace (and not attached): [1] Rcpp_1.0.0 lubridate_1.7.4 assertthat_0.2.0 digest_0.6.18 [5] R6_2.3.0 cellranger_1.1.0 repr_0.18 ggplot2_3.1.0 [9] pillar_1.3.1 rlang_0.3.0.1 lazyeval_0.2.1 curl_3.2 [13] readxl_1.2.0 rstudioapi_0.8 car_3.0-2 urltools_1.7.1 [17] stringr_1.3.1 foreign_0.8-71 triebeard_0.3.0 munsell_0.5.0 [21] compiler_3.4.3 pkgconfig_2.0.2 base64enc_0.1-3 htmltools_0.3.6 [25] tidyselect_0.2.5 tibble_1.4.2 gridExtra_2.3 httpcode_0.2.0 [29] rio_0.5.16 XML_3.98-1.16 crayon_1.3.4 dplyr_0.7.8 [33] hoardr_0.5.2 rappdirs_0.3.1 crul_0.6.0 grid_3.4.3 [37] jsonlite_1.6 gtable_0.2.0 magrittr_1.5 scales_1.0.0 [41] zip_1.0.0 stringi_1.2.4 carData_3.0-2 sp_1.3-1 [45] xml2_1.2.0 openxlsx_4.1.0 tools_3.4.3 forcats_0.3.0 [49] glue_1.3.0 purrr_0.2.5 hms_0.4.2 abind_1.4-5 [53] colorspace_1.3-2 bindr_0.1.1 haven_2.0.0 ```
brian-may commented 5 years ago

This is probably due to the partial shutdown of the US Government.

https://ncdc.noaa.gov/ redirects to https://governmentshutdown.noaa.gov/

ghaines3 commented 5 years ago

ugh.

That makes sense, thanks.

sckott commented 5 years ago

correct, NOAA web services are down. and they don't fail well so we have a hard time giving users helpful information.

AFAICT NOAA FTP services are all up though

sckott commented 5 years ago

I made a change in the ncdc() functions, it should error with a useful message now if you reinstall from here.

ncdc_datasets()
#> Error in check_response(ncdc_GET("datasets", args, token, ...)) :
#>   there's a government shutdown; check back later
sckott commented 5 years ago

govt still down, but better error messagse in place