Skip to content
Prev 207256 / 398503 Next

Looping multiple dimensions

I would suggest that you use a 'list' for the data.  Something like
this should work:

objs <- grep("^mrunoff_", ls(), values=TRUE)  # get the names of the objects
result <- lapply(objs, function(.obj){
    .obj <- get(.obj)  # get the value
    lapply(1:12, function(. iter)  .obj[,, .iter])
})
On Fri, Jan 22, 2010 at 11:32 AM, Steve Murray <smurray444 at hotmail.com> wrote: