Re: [R] trouble using sapply to perform multiple t-test

2014-02-16 Thread David Romano
Thanks Arun and Jim; this helps me sort out several points I hadn't been aware of! -David On Sat, Feb 15, 2014 at 1:39 PM, arun wrote: > > > Hi David, > Try: > Check the output of: > lapply(mm,function(x) x) #mm is matrix > #and > lapply(as.data.frame(mm),function(x) x) > > > > > sapply(spl

Re: [R] trouble using sapply to perform multiple t-test

2014-02-15 Thread arun
Hi David, Try: Check the output of: lapply(mm,function(x) x) #mm is matrix #and lapply(as.data.frame(mm),function(x) x)   sapply(split(mm,col(mm)),function(x){out <- t.test(x[1:15],x[16:25])$p.value})  #   1 2 #0.1091573 1.000 #or  sapply(as.data.frame(mm), function(x) 

Re: [R] trouble using sapply to perform multiple t-test

2014-02-15 Thread Jim Lemon
On 02/16/2014 07:16 AM, David Romano wrote: Hi folks, I'm having trouble with code that used to work, and I can't figure out what's going wrong. I'd be grateful for any help in sorting this out. Suppose I define a matrix mm<- matrix(1:15, 25,2) and compare the first 15 values of column 1 of

[R] trouble using sapply to perform multiple t-test

2014-02-15 Thread David Romano
Hi folks, I'm having trouble with code that used to work, and I can't figure out what's going wrong. I'd be grateful for any help in sorting this out. Suppose I define a matrix > mm <- matrix(1:15, 25,2) and compare the first 15 values of column 1 of mm to the values remaining in the same colum