Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading 2020 lcd data #344

Closed
juliannemeehan opened this issue Mar 19, 2020 · 2 comments
Closed

Error downloading 2020 lcd data #344

juliannemeehan opened this issue Mar 19, 2020 · 2 comments
Milestone

Comments

@juliannemeehan
Copy link

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
> 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 sckott added this to the v0.9.6 milestone Mar 19, 2020
@sckott sckott added the bug label Mar 19, 2020
@sckott
Copy link
Contributor

sckott commented Mar 19, 2020

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 added a commit that referenced this issue Mar 19, 2020
use a new utiliity fxn for safe reading of csv files with more informative error message
export lcd_cache and make manual file for it so that users can manage the lcd cache
change internal fxn read_csv to storms_read_csv as it was only used for storms
add utilities tests file, add test for lcd() for bad files
@sckott
Copy link
Contributor

sckott commented Mar 19, 2020

@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

@sckott sckott added the caching label Mar 19, 2020
@sckott sckott closed this as completed Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants