aggregate.time.series  R Documentation 
Aggregate measurements from a fine scaled time series into
a coarse time series. This is similar to functions from the
xts
package, but it can handle aggregation from weeks to
months.
AggregateTimeSeries(fine.series,
contains.end,
membership.fraction,
trim.left = any(membership.fraction < 1),
trim.right = NULL,
byrow = TRUE)
fine.series 
A numeric vector or matrix giving the fine scale time series to be aggregated. 
contains.end 
A logical vector corresponding to

membership.fraction 
A numeric vector corresponding to

trim.left 
Logical indicating whether the first observation in the coarse aggregate should be removed. 
trim.right 
Logical indicating whether the final observation in the coarse aggregate should be removed. 
byrow 
Logical. If 
A matrix (if fine.series
is a matrix) or vector
(otherwise) containing the aggregated values of fine.series
.
Steven L. Scott steve.the.bayesian@gmail.com
week.ending < as.Date(c("20111105",
"20111112",
"20111119",
"20111126",
"20111203",
"20111210",
"20111217",
"20111224",
"20111231"))
membership.fraction < GetFractionOfDaysInInitialMonth(week.ending)
which.month < MatchWeekToMonth(week.ending, as.Date("20111101"))
contains.end < WeekEndsMonth(week.ending)
weekly.values < rnorm(length(week.ending))
monthly.values < AggregateTimeSeries(weekly.values, contains.end, membership.fraction)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.