Re: [R] Matrix operation

2013-09-24 Thread arun
Hi, Try: set.seed(49) qcd<- matrix(sample(1:20,124*69,replace=TRUE),ncol=69) set.seed(345) listt<- matrix(sample(1:80,124*5,replace=TRUE),ncol=5) lst1<-list(c(15,2),c(56,54),c(15,62),c(4,14))  names(lst1)<- 2:5 S<- do.call(cbind,lapply(names(lst1),function(i) {ww<-listt[,as.numeric(i),drop=FAL

[R] Matrix operation with apply family functions

2011-07-11 Thread Dimitris.Kapetanakis
Dear all, I am trying to use the apply family functions to improve the efficiency of my code, though it is a bit hard for me to find sometimes the solutions with these functions. The problem that I want to solve is: I have a matrix of replicated random generated data, e.g. if I have two control