[R] Strange Colnames

Georg Hoermann georg.hoermann at gmx.de
Fri Feb 25 15:42:11 CET 2005


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




More information about the R-help mailing list