aggregate.weeks.to.months | R Documentation |
Aggregate measurements from a weekly time series into a monthly time series.
AggregateWeeksToMonths(weekly.series,
membership.fraction = NULL,
trim.left = TRUE,
trim.right = NULL)
weekly.series |
A numeric vector or matrix of class
|
membership.fraction |
A optional numeric vector corresponding to
|
trim.left |
Logical indicating whether the first observation in the monthly aggregate should be removed. |
trim.right |
Logical indicating whether the final observation in the monthly aggregate should be removed. |
A zoo-matrix (if weekly.series
is a matrix) or vector
(otherwise) containing the aggregated values of weekly.series
.
Steven L. Scott steve.the.bayesian@gmail.com
AggregateTimeSeries
week.ending <- as.Date(c("2011-11-05",
"2011-11-12",
"2011-11-19",
"2011-11-26",
"2011-12-03",
"2011-12-10",
"2011-12-17",
"2011-12-24",
"2011-12-31"))
weekly.values <- zoo(rnorm(length(week.ending)), week.ending)
monthly.values <- AggregateWeeksToMonths(weekly.values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.