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

weather_dl() function returns an error, even when using example provided in the docs #98

Closed datacarvel closed 4 years ago

datacarvel commented 4 years ago

Expected Behavior

_I am simply trying to download weather data using the weatherdl() function. I am guessing it should return the data.

Current Behavior

I try downloading data with the provided example in the doc, but even this does not work and returns an error : kam <- weather_dl(station_ids = 51423, start = "2016-01-01", end = "2016-02-15") Error message : Error in 1:grep("Date/Time", preamble$V1) : argument of length 0

Steps to Reproduce (for bugs)

See above

Possible Solution

Context

I am trying to download hourly weather data for a few stations in Quebec, ideally from January 2017 to today.

Your Environment

`- Session info ---------------------------------------------------------------------------------------------------------------------------- setting value
version R version 3.5.2 (2018-12-20) os Windows >= 8 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate French_Canada.1252
ctype French_Canada.1252
tz America/New_York
date 2020-04-23

[1] C:/Users/scarufel/Documents/R/win-library/3.5 [2] C:/Program Files/R/R-3.5.2/library`

steffilazerte commented 4 years ago

Hmm, I can't replicate the problem which makes me think it might be a weird package dependency issue (assuming you're using the most recent version of weathercan v0.3.4). These are super hard to track down, but can usually be fixed by updating packages.

1) Try updating weathercan to the most recent version (if it's not already): install.packages('weathercan')

  1. If that doesn't help, try updating your packages that weathercan depends on: remotes::update_packages("weathercan", dependencies = TRUE)

  2. If that doesn't help, try updating all your packages: remotes::update_packages()

Please let me know what (if anything) helped!

datacarvel commented 4 years ago

Well now I don't feel super smart 😂 weathercan was just not updated, it resolved the issue. Been using R for a while now but still don't have the reflex to check the package version. Anyway, thanks a lot for this quick reply and solution!

steffilazerte commented 4 years ago

Glad that worked out! I've been using R for about 13 years now and you'd be surprised how often package versions throw me for a loop :grin: