Description Usage Arguments Value Author(s) See Also Examples
Aggregate xts object by a given function. It can be any function defined by the user. Actually it's possible to aggregate data by day, month, week, quarter and year.
1 |
daxts |
object of calss |
FUN |
a function defined by the user. |
freq |
a char string to the aggregation. It can be daily, weekly, monthly, quarterly or yearly |
dig |
number of output digits |
a object from class xts
with the data aggregated
LOPES, J. E.
1 2 3 4 5 | data(datasample)
d1 <- cvforecast::ConvertData(datasample, tsfrequency = "day", OutType = "xts", OutlierClean = FALSE)
fun1 <- function(x) {c(mean(x, na.rm=TRUE) + sd(x,na.rm=TRUE))}
aggreg(d1[,1:5], fun1, "monthly")
aggreg(d1[,1:5], mean, "monthly")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.