Re: [R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Lisa
Hi, Phil, Yes. That's what I am looking for. Thank you so much. Lisa -- View this message in context: http://r.789695.n4.nabble.com/Arrange-a-multi-level-list-to-a-one-level-list-tp3556500p3556601.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Phil Spector
Lisa - Are you looking for this? x <- list(list(matrix(sample(c(0,1), 4, replace = T), 2), + matrix(sample(c(2,3), 4, replace = T), 2)), + list(matrix(sample(c(0,1), 6, replace = T), 2), matrix(sample(c(2,3), 6, + replace = T), 2))) unlist(x,recursive=FALSE) [[1]] [,1] [,2] [1,]0

[R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Lisa
Dear all, I just want to arrange a multi-level list to a one-level list. For example: x <- list(list(matrix(sample(c(0,1), 4, replace = T), 2), matrix(sample(c(2,3), 4, replace = T), 2)), list(matrix(sample(c(0,1), 6, replace = T), 2), matrix(sample(c(2,3), 6, replace = T), 2))) > x [[1]] [[1]][