View source: R/aggregate_by_date.R
aggregate_by_date | R Documentation |
aggregate_by_date
does a similar job and has the same objectives of
openair's timeAverage
. However, it has been developed
to perform on "longer" data which is often encountered.
aggregate_by_date(
df,
interval = "hour",
by = NA,
summary = "mean",
threshold = 0,
round = NA,
pad = TRUE,
determine_interval = TRUE,
uniform_padding = FALSE,
warn = TRUE,
verbose = FALSE
)
df |
Input data frame to be aggregated. |
interval |
What interval should the aggregation be? Default is
|
by |
What variables should |
summary |
What summary function should be applied for the aggregation?
Default is the
|
threshold |
What data capture threshold is needed to create a valid
aggregation. This is an value between |
round |
Should the aggregations be rounded? Default is no but |
pad |
Should the time series be padded before aggregation? Almost always
this will be |
determine_interval |
Should the input time series be evaluate to find
it's averaging period/interval. This is required for the correct calculation
of |
uniform_padding |
If a |
warn |
Should the function return warnings in certain situations? |
verbose |
Should the function give messages? |
Tibble.
Stuart K. Grange
timeAverage
, time_pad
## Not run:
# Aggregate to hourly means
aggregate_by_date(data_air, "hour", by = c("site", "variable"))
# Multiple intervals are also supported, such as multiple days
aggregate_by_date(data_air, "14 days", by = c("site", "variable"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.