View source: R/monthlyClimate.R
download.climateSummaries | R Documentation |
Data are downloaded from the Environment and Climate Change Canada's climate weather website and cached locally
download.climateSummaries(
year,
month,
province,
type,
destdir = ".",
destfile,
force = TRUE
)
year |
A number giving the year of interest. |
month |
A number giving the month of interest. |
province |
A string giving the province abbreviation of interest. |
type |
A string indicating which type of file to download, either
|
destdir |
Optional string indicating the directory in which to store downloaded files. If not supplied, "." is used, i.e. the data file is stored in the present working directory. |
destfile |
Optional string indicating the name of the file. If not supplied, the file name is constructed from the other parameters of the function call, so subsequent calls with the same parameters will yield the same result, thus providing the key to the caching scheme. |
force |
Logical value indicating whether to force a download, even if the file already exists locally. |
The data are downloaded from
http://climate.weather.gc.ca/prods_servs/cdn_climate_summary_report_e.html
using utils::download.file()
pointed to the Environment and Climate Change Canada website (reference 1)
using queries that had to be devised by reverse-engineering, since the agency
does not provide documentation about how to construct queries. Caution: the
query format changes from time to time, so download.met.climateSummaries()
may work one
day, and fail the next.
Chantelle Layton
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.