seandavi / sars2pack

An R package with over 50 highly cited, read-to-use, up-to-date COVID-19 pandemic data resources
https://seandavi.github.io/sars2pack/
Other
59 stars 14 forks source link

[BUG] `covidtracker_data()` fails #36

Closed Joe-Wasserman closed 4 years ago

Joe-Wasserman commented 4 years ago

Describe the bug covidtracker_data() fails to download the expected data. I think the cause is that they started versioning their API, so the correct URL to the csv is now "http://covidtracking.com/api/v1/states/daily.csv"

To Reproduce covidtracker_data() returns the following error:

Error: Can't subset columns that don't exist.
x The columns `date`, `state`, `positive`, `negative`, `pending`, etc. don't exist.

Ouptput of sessionInfo

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 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] plotly_4.9.2               sars2pack_0.0.47           sf_0.9-2                   R0_1.2-6                  
 [5] MASS_7.3-51.6              geofacet_0.1.10            tidyquant_1.0.0            quantmod_0.4-15           
 [9] TTR_0.23-5                 PerformanceAnalytics_2.0.4 xts_0.11-2                 zoo_1.8-6                 
[13] lubridate_1.7.8            ggplot2_3.3.0              purrr_0.3.4                tidyr_1.0.2               
[17] dplyr_0.8.5                Cairo_1.5-10               knitr_1.24                

loaded via a namespace (and not attached):
  [1] colorspace_1.4-1      ellipsis_0.3.0        class_7.3-17          base64enc_0.1-3       rstudioapi_0.10      
  [6] npsurv_0.4-0          MatrixModels_0.4-1    ggrepel_0.8.1         bit64_0.9-7           fansi_0.4.1          
 [11] xml2_1.3.1            splines_3.6.3         lsei_1.2-0            jsonlite_1.6.1        mcmc_0.9-7           
 [16] dbplyr_1.4.2          png_0.1-7             rgeos_0.5-2           shiny_1.4.0.2         BiocManager_1.30.10  
 [21] readr_1.3.1           compiler_3.6.3        httr_1.4.1            lazyeval_0.2.2        assertthat_0.2.1     
 [26] Matrix_1.2-18         fastmap_1.0.1         cli_2.0.2             later_1.0.0           htmltools_0.4.0      
 [31] quantreg_5.54         tools_3.6.3           coda_0.19-3           gtable_0.3.0          glue_1.4.0           
 [36] reshape2_1.4.3        rappdirs_0.3.1        Rcpp_1.0.4.6          cellranger_1.1.0      imguR_1.0.3          
 [41] webdriver_1.0.5       vctrs_0.2.4           countrycode_1.1.2     debugme_1.1.0         crosstalk_1.0.0      
 [46] xfun_0.8              stringr_1.4.0         ps_1.3.0              openxlsx_4.1.4        rvest_0.3.5          
 [51] mime_0.7              lifecycle_0.2.0       scales_1.0.0          BiocStyle_2.14.4      hms_0.5.0            
 [56] promises_1.1.0        coarseDataTools_0.6-5 SparseM_1.77          yaml_2.2.1            curl_4.3             
 [61] memoise_1.1.0         gridExtra_2.3         incidence_1.7.1       stringi_1.4.3         RSQLite_2.1.2        
 [66] highr_0.8             e1071_1.7-3           zip_2.0.4             rlang_0.4.5           pkgconfig_2.0.3      
 [71] geogrid_0.1.1         evaluate_0.14         lattice_0.20-41       labeling_0.3          htmlwidgets_1.5.1    
 [76] bit_1.1-15.2          tidyselect_1.0.0      processx_3.4.1        showimage_1.0.0       plyr_1.8.4           
 [81] magrittr_1.5          R6_2.4.1              generics_0.0.2        DBI_1.1.0             pillar_1.4.3         
 [86] withr_2.1.2           fitdistrplus_1.0-14   units_0.6-4           survival_3.1-12       sp_1.3-1             
 [91] tibble_3.0.1          crayon_1.3.4          Quandl_2.10.0         KernSmooth_2.23-17    utf8_1.1.4           
 [96] BiocFileCache_1.10.2  rmarkdown_2.1         jpeg_0.1-8.1          rnaturalearth_0.1.0   grid_3.6.3           
[101] readxl_1.3.1          data.table_1.12.6     blob_1.2.1            callr_3.3.1           digest_0.6.25        
[106] classInt_0.4-1        xtable_1.8-4          httpuv_1.5.2          MCMCpack_1.4-6        munsell_0.5.0        
[111] viridisLite_0.3.0     EpiEstim_2.2-1        quadprog_1.5-7