Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x <- xts(matrix(rnorm(500*8),ncol=8),Sys.Date()-500:1)
- x.m <- split(x,'months')
- ff <- function(xts.obj){xts.obj[,c(1:4)]}
- g <- lapply(x.m, ff)
- > args(xts:::`[.xts`)
- function (x, i, j, drop = FALSE, which.i = FALSE, ...)
- NULL
- lapply(x.m, '[', , c(1:4))
- lapply(x.m, '[', j=c(1:4))
- g <- lapply(x.m, FUN = function(x){x[, c(1:4]}
Add Comment
Please, Sign In to add comment