Use this function to get Environment Canada climate data in bulk over multiple years and/or stations.
getClimateData(stationID, timeframe = c("monthly", "daily", "hourly"),
year = NULL, month = NULL, day = NULL, cache = "ec.cache",
quiet = TRUE, progress = c("text", "none", "tk"), format = c("wide",
"long"), rm.na = FALSE, parsedates = TRUE, checkdates = TRUE,
nicenames = FALSE, ply = plyr::adply)getClimateMUData(stationID, timeframe = c("monthly", "daily", "hourly"),
year = NULL, month = NULL, day = NULL, cache = "ec.cache",
quiet = TRUE, progress = c("text", "none", "tk"), rm.na = FALSE,
dataset.id = "ecclimate")
The station ID, possibly found by getClimateSites
One of "monthly", "hourly", or "daily"
A vector of years for which to fetch data
A vector of months for which to fetch data
A vector of day numbers for which to fetch data
A folder in which to cache downloaded files
Suppress update messages
A plyr progress bar, one of "text", "tk", or "none"
One of "wide" or "long". Use long for easy integration with ggplot.
Pass rm.na=TRUE to remove rows with no values. This may help compress large datasets
Flag to parse date/time information (useful for plotting).
If checkdates is TRUE, the loop will not attempt to download if a year is marked as missing in ecclimatelocs. Note that this information may be out of date, but this flag is useful to minimize the amount of downloading that needs to occur. This will also subset the resulting data frame to only contain the years/months requested.
Use lower-case, unit-free names for columns.
The plyr-like function that executes the loop and returns the result. Pass your own function accepting named arguments .data, .margins=1, .fun=function(row), .progress. This may be useful if all you need to do is extract information out of a large amount of climate data without the need to store it to disk.
The dataset identifier to use for mudata creation.
A data.frame (or the results of ply if passed).
http://climate.weather.gc.ca/historical_data/search_historic_data_e.html ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/Readme.txt