Learn R Programming

rclimateca (version 1.0.2)

getClimateData: DEPRECATED: Get Parsed and aggregated Environment Canada data

Description

Use this function to get Environment Canada climate data in bulk over multiple years and/or stations.

Usage

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")

Arguments

stationID

The station ID, possibly found by getClimateSites

timeframe

One of "monthly", "hourly", or "daily"

year

A vector of years for which to fetch data

month

A vector of months for which to fetch data

day

A vector of day numbers for which to fetch data

cache

A folder in which to cache downloaded files

quiet

Suppress update messages

progress

A plyr progress bar, one of "text", "tk", or "none"

format

One of "wide" or "long". Use long for easy integration with ggplot.

rm.na

Pass rm.na=TRUE to remove rows with no values. This may help compress large datasets

parsedates

Flag to parse date/time information (useful for plotting).

checkdates

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.

nicenames

Use lower-case, unit-free names for columns.

ply

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.

dataset.id

The dataset identifier to use for mudata creation.

Value

A data.frame (or the results of ply if passed).

References

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