Hello,

Try ?unlist.
unlist(abun)

Hope this helps,

Rui Barradas
Em 03-09-2012 17:06, chris20 escreveu:
Hi,
I am trying to combine a long list but I can't work out how to do it, for
example:

abun<-list(rep(0,5),rep(0,7),rep(0,4),rep(0,10))
nb<-c(5,5,1,8)

fill.abun <- function(x, y) {
         set <- sample(1:length(x), size = y)
         x[set] <- rlnorm(length(set))
         return(x)
     }
abun <- mapply(fill.abun, abun, nb)
abun

## I want all the data in one list or column which I can extract to a
dataframe or matrix
## the best I have come up with is:

abun2<-c(abun[[1]],abun[[2]],abun[[3]],abun[[4]])

## but I will have a lot more data and so this is not feasible

Thanks,
Chris



--
View this message in context: 
http://r.789695.n4.nabble.com/combing-list-objects-tp4642071.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to