this function is primarily designed for use with portfolio functions passing 'x' or 'R' and weights, but may be usable for other things as well, see Example for a vector example.
trailingFUN(R, weights, n = 0, FUN, FUNargs = NULL, ...)
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
a vector of weights to test
numeric number of trailing periods
string describing the function to be called
list describing any additional arguments
any other passthru parameters
called with e.g.
trailingFUN(seq(1:100), weights=NULL, n=12, FUN='mean',FUNargs=list())