ropensci / rnoaa

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

Error downloading 2020 lcd data #344

Closed juliannemeehan closed 4 years ago

juliannemeehan commented 4 years ago

I am trying to download 2020 data using the lcd function:

lcd(72517014737, year = as.integer(2020), verbose = F)

I get the error message: Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input

I have check the file index: https://www.ncei.noaa.gov/data/local-climatological-data/access/2020/ and there is data for 2020 for this station.

Session Info ```r > sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] forcats_0.4.0 stringr_1.4.0 dplyr_0.8.3 purrr_0.3.3 [5] readr_1.3.1 tidyr_1.0.0 tibble_2.1.3 ggplot2_3.2.1 [9] tidyverse_1.3.0 readxl_1.3.1 rnoaa_0.9.5 loaded via a namespace (and not attached): [1] tidyselect_0.2.5 haven_2.2.0 lattice_0.20-38 colorspace_1.4-1 [5] vctrs_0.2.0 generics_0.0.2 XML_3.98-1.20 rlang_0.4.1 [9] pillar_1.4.2 withr_2.1.2 httpcode_0.2.0 glue_1.3.1 [13] DBI_1.0.0 rappdirs_0.3.1 dbplyr_1.4.2 modelr_0.1.5 [17] lifecycle_0.1.0 munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 [21] rvest_0.3.5 curl_4.2 hoardr_0.5.2 broom_0.5.2 [25] Rcpp_1.0.3 backports_1.1.5 scales_1.0.0 jsonlite_1.6 [29] fs_1.3.1 gridExtra_2.3 hms_0.5.2 digest_0.6.22 [33] stringi_1.4.3 grid_3.6.1 cli_1.1.0 tools_3.6.1 [37] magrittr_1.5 lazyeval_0.2.2 crul_0.9.0 crayon_1.3.4 [41] pkgconfig_2.0.3 zeallot_0.1.0 xml2_1.2.2 reprex_0.3.0 [45] lubridate_1.7.4 assertthat_0.2.1 httr_1.4.1 rstudioapi_0.10 [49] R6_2.4.1 nlme_3.1-140 compiler_3.6.1 ```
sckott commented 4 years ago

thanks for the issue. I can replicate the problem. it's due most likely to a cached file on disk matching the query, but that is empty or malformed. looking into it

sckott commented 4 years ago

@juliannemeehan please restart R, reinstall like remotes::install_github("ropensci/rnoaa"), then see the new ?lcd_cache, you can manage your lcd cached files with that object.

lcd_cache$delete_all() # or lcd_cache$delete() to delete specific files
lcd(72517014737, 2020)

should work