Re: [R] Applying 'cbind/rbind' among different list object

2011-02-06 Thread Phil Spector
Another possibility is mapply(rbind,list1,list2,SIMPLIFY=FALSE) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Applying 'cbind/rbind' among different list object

2011-02-06 Thread jim holtman
will this do it for you: > lapply(seq(length(list1)), function(i)rbind(list1[[i]], list2[[i]])) [[1]] [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]5 10 15 20 25 [6,] 10 11

[R] Applying 'cbind/rbind' among different list object

2011-02-06 Thread B. Jonathan B. Jonathan
Hi, I am wondering whether we can apply 'cbind/rbind' on many **equivalent** list objects. For example please consider following: > list1 <- list2 <- vector("list", length=2); names(list1) <- names(list2) <- c("a", "b") > list1[[1]] <- matrix(1:25, 5) > list1[[2]] <- matrix(2:26, 5) > list2[[1]] <