ropensci / weathercan

R package for downloading weather data from Environment and Climate Change Canada
https://docs.ropensci.org/weathercan
GNU General Public License v3.0
102 stars 29 forks source link

Unable to download weather data #95

Closed tspeidel closed 4 years ago

tspeidel commented 4 years ago

Hi there, I'm unable to download data using weather_dl. I tried both the dev version and the stable one.

Using example in documentation

> library(weathercan)
> kam <- weather_dl(station_ids = 51423, start = "2018-02-01", end = "2018-04-15")
Error in matrix(if (is.null(value)) logical() else value, nrow = nr, dimnames = list(rn,  : 
   length of 'dimnames' [2] not equal to array extent

## Session
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

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 datasets  utils     methods   base     

other attached packages:
[1] weathercan_0.3.3 hrbrthemes_0.8.0 ggplot2_3.3.0    extrafont_0.17  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4          gert_0.3            lubridate_1.7.8     lattice_0.20-38    
 [5] tidyr_1.0.2         prettyunits_1.1.1   ps_1.3.2            clisymbols_1.2.0   
 [9] rprojroot_1.3-2     assertthat_0.2.1    packrat_0.5.0       digest_0.6.25      
[13] prompt_1.0.0        utf8_1.1.4          R6_2.4.1            backports_1.1.6    
[17] evaluate_0.14       httr_1.4.1          pillar_1.4.3        gdtools_0.2.2      
[21] rlang_0.4.5.9000    curl_4.3            rstudioapi_0.11     extrafontdb_1.0    
[25] callr_3.4.3         rmarkdown_2.1.1     stringr_1.4.0       munsell_0.5.0      
[29] compiler_3.6.3      xfun_0.13           pkgconfig_2.0.3     askpass_1.1        
[33] systemfonts_0.1.1   pkgbuild_1.0.6      htmltools_0.4.0     openssl_1.4.1      
[37] tidyselect_1.0.0    tibble_3.0.0        fansi_0.4.1         memuse_4.1-0       
[41] crayon_1.3.4        dplyr_0.8.5         withr_2.1.2         grid_3.6.3         
[45] Rttf2pt1_1.3.8      gtable_0.3.0        lifecycle_0.2.0     magrittr_1.5       
[49] credentials_1.1     scales_1.1.0        cli_2.0.2           stringi_1.4.6      
[53] rprofile_0.1.0.9006 remotes_2.1.1       sp_1.4-1            ellipsis_0.3.0     
[57] generics_0.0.2      vctrs_0.2.4         tools_3.6.3         glue_1.4.0         
[61] purrr_0.3.3         processx_3.4.2      yaml_2.2.1          colorspace_1.4-1   
[65] memoise_1.1.0       knitr_1.28         
steffilazerte commented 4 years ago

Hi @tspeidel,

Try the dev branch:

remotes::install_github("ropensci/weathercan", ref = "dev_0.3.4")

I'm just about to push that branch to master and then submit to CRAN. The most recent version of tibble broke a lot of packages and I'm also preemptively fixing problems which will arise from upcoming changes to the dplyr.

My guess is that this is the problem.

tspeidel commented 4 years ago

Yep, that fixed it! Thanks for the quick reply.