[,1:27])+rowSds(permutation[,28:38]))}
)) })
# user system elapsed
# 3.624 0.000 3.632
identical(fourPGCs,res)
#[1] TRUE
A.K.
- Original Message -
From: David Winsemius
To: arun
Cc: R help
Sent: Saturday, May 11, 2013 2:31 PM
Subject: Re: [R] How to repeat 2 functions in suc
On May 11, 2013, at 9:21 AM, arun wrote:
> Hi,
> May be this helps:
>
> set.seed(24)
> mydata4<- as.data.frame(matrix(sample(1:100,10*38,replace=TRUE),ncol=38))
> dim(mydata4)
> #[1] 10 38
> library(matrixStats)
> res<-do.call(cbind,lapply(1:400, function(i) {permutation<-sample(mydata4);
Hi,
May be this helps:
set.seed(24)
mydata4<- as.data.frame(matrix(sample(1:100,10*38,replace=TRUE),ncol=38))
dim(mydata4)
#[1] 10 38
library(matrixStats)
res<-do.call(cbind,lapply(1:400, function(i) {permutation<-sample(mydata4);
(rowMeans(permutation[,1:27])-rowMeans(permutation[,28:38]))/
3 matches
Mail list logo