Gabor Grothendieck wrote:
Here is something you could try:
# define lags and their names
lags <- 0:4
names(lags) <- c("G_HW", paste("lag", 1:4))
# build mts
do.call("cbind", lapply(lags, lag, x = lagtest))
thank you for the solution,
I will try to understand it during the weekend 8-)
Now I tried to change the lag from the default value of 1 to -1,
but I apparently missed something:
> do.call("cbind", lapply(lags, function(x) lag(x,-1), x = lagtest))
Error in FUN(X[[1]], ...) : unused argument(s) ( ...)
where is the unused argument?
Thanks,
Georg
--
Georg Hoermann, Dep. of Hydrology, Ecology, Kiel University, Germany
Tel. 0431-880-1207, Home: 0451/477032, 0172/4315715, Penguin #189476
______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html