aggDataframe | R Documentation |
CRHM data (observations and outputs) are generally produced at hourly time steps. This function aggregates CRHM data to daily, monthly or yearly values. The data can be aggregated by their maxima, minima, means, sums and any combination of these statistics.
aggDataframe(
CRHMdataframe,
columns = 1,
period = "annual",
funs = c("mean"),
AggFilename = "",
startMonth = 10,
useSecondYear = TRUE,
omitMissing = FALSE,
logfile = ""
)
CRHMdataframe |
Required. A valid CRHMr data frame. |
columns |
The columns to be aggregated, not including the datetime. The default is the first column. This can be a vector, i.e. c(1,2,3). |
period |
The period of aggregation. Must be one of hourly, daily, monthly, yearly (or annual) or hydro. Default is yearly. Multiple-hour aggregation is not yet supported. |
funs |
A character vector containing the function(s) for aggregation. The default is mean,
but can also include min, max, sum, length, |
AggFilename |
Optional. File name for the aggregated data. |
startMonth |
Optional. Starting month, to be used when aggregating by hydrological year. |
useSecondYear |
Optional. Logical. Should the hydrological year be based on the first or second calendar year.
In other words would January 1, 2015 be the hydrological year 2014 or 2015? The default is |
omitMissing |
Optional. If |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
Returns a data frame with the aggregated values.
The period of aggregation must be greater than the time step of the CRHM data.
This function does NOT remove NA
values before differencing.
Kevin Shook
interpolate
impute
yearlyPeaks
hydroYear
Badlake.t.monthly <- aggDataframe(BadLake7376,
period = "monthly",
columns = 1, funs = c("mean")
)
Badlake.radiation.daily <- aggDataframe(BadLake7376,
period = "daily",
columns = c(6, 7, 8), funs = c("mean")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.