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

Download multiple years but only certain months #68

Open
steffilazerte opened this issue Feb 13, 2019 · 0 comments
Open

Download multiple years but only certain months #68

steffilazerte opened this issue Feb 13, 2019 · 0 comments
Labels

Comments

@steffilazerte
Copy link
Member

This is a problem and short-term solution reported by John Lewis.

Question: Is it possible to selectively download only winter months across multiple stations and multiple years?
Answer: It is possible in the future to implement that for hourly data, but it is currently not implemented (and won't be immediately implemented)

John presented this work-around in the meantime:

library("weathercan")
library("tidyverse")
stations_search("Ottawa", interval = "hour")

#example of downloading data for specific time period(s) during a year
#in this case it is for 4 years of winter hourly data for Ottawa
st <- c("2011-12-14","2012-11-01","2013-11-01","2014-11-01")
ed <-c("2012-03-31","2013-03-31","2014-03-31","2015-03-31")
otta <- vector("list", length(st))
for (i in seq_along(st)){
    otta[[i]] <- weather_dl(station_id=49568,start = st[[i]],
       end = ed[[i]])
}

otta

##########################
#View(out)
#if you want to combine the data into one large data frame you can
#save the output in a list, then use dplyr::bind_rows(output) to
#combine the output into a single data frame.
ott <- dplyr::bind_rows(otta)
head(ott)
tail(ott)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant