Skip to content
Prev 238079 / 398500 Next

for loop

If unlisting was the only issue, then this should also work, and will
save you the trouble of initializing a matrix, creating x, and using a
for loop.

## Brian's Function
f <- function(x) {
       r <- as.list(rnorm(6))
       names(r) <- paste("T",1:6,sep="")
       r
}

sapply(seq(0,1, by=0.1), function(x) {unlist(f(x))})

Cheers,

Josh
On Thu, Oct 14, 2010 at 3:43 PM, li li <hannah.hlx at gmail.com> wrote: