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

Missing 2019 data #94

Closed greenLauren closed 4 years ago

greenLauren commented 4 years ago

When using the station_search method, the end period for Edmonton stations goes until 2018. While the Environment Canada website shows data from 2019. When you try to retrieve this data in R, you get an error.

library(weathercan)

station<-stations_search("Edmonton", interval =  "hour")
station<-station %>%filter(end > 2019)

edmonton_data<-weather_dl(station_ids = station$station_id, start ="2019-01-01",end="2019-12-31")

Error in 1:grep("Date/Time", preamble$V1) : argument of length 0

boshek commented 4 years ago

Hi @greenLauren

I am not able to replicate this. Which version of weathercan are you using? Try updating to 0.3.3 if you don't have the most recent version of weathercan.

ebourlon commented 4 years ago

maybe filter should be >=2019

Le lun. 16 mars 2020 à 13:30, greenLauren notifications@github.com a écrit :

When using the station_search method, the end period for Edmonton stations goes until 2018. While the Environment Canada website shows data from 2019. When you try to retrieve this data in R, you get an error. https://climate.weather.gc.ca/climate_data/hourly_data_e.html?hlyRange=1999-06-23%7C2020-03-15&dlyRange=1996-03-01%7C2020-03-15&mlyRange=1996-03-01%7C2007-11-01&StationID=27214&Prov=AB&urlExtension=_e.html&searchType=stnName&optLimit=yearRange&StartYear=2019&EndYear=2020&selRowPerPage=25&Line=0&searchMethod=contains&Month=12&Day=31&txtStationName=edmonton&timeframe=1&Year=2019

`library(weathercan)

station<-stations_search("Edmonton", interval = "hour") station<-station %>%filter(end > 2019)

edmonton_data<-weather_dl(station_ids = station$station_id, start ="2019-01-01",end="2019-12-31")

` Error in 1:grep("Date/Time", preamble$V1) : argument of length 0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/weathercan/issues/94, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGNA6HWQLN7NGS4LZHXJB4DRHZH3ZANCNFSM4LMNGHBA .

greenLauren commented 4 years ago

@boshek @ebourlon it was weird, when I looked at the end dates they ended in 2018 or earlier for the most part.

I updated the package and the data retrieved ended in 2019 or 2020. I'm not sure if the version I was using had a different api call or what, but regardless updating the package worked.

Thanks!

steffilazerte commented 4 years ago

Hi @greenLauren, when you updated the package you updated the internal stations data frame. You can update that manually, if you find that it doesn't match the stations listed by ECCC (see the Getting Started vignette, particularly the stations_dl() function for more details).