Re: [R] subsetting of factor

2008-09-12 Thread Hui-Yi Chu
Hi Adai, It works!! Thanks a lot!! Hui-Yi On Fri, Sep 12, 2008 at 11:26 AM, Adaikalavan Ramasamy < [EMAIL PROTECTED]> wrote: > help(rowttests) says that fac needs to be a factor. So how about ? > > m <- matrix( rnorm(30), nc=6 ) > genotype <- c("a", "a", "b", "b", "c", "c") > > w1 <- which(

Re: [R] subsetting of factor

2008-09-12 Thread Adaikalavan Ramasamy
help(rowttests) says that fac needs to be a factor. So how about ? m <- matrix( rnorm(30), nc=6 ) genotype <- c("a", "a", "b", "b", "c", "c") w1 <- which( genotype %in% c("a", "b") ) w2 <- which( genotype %in% c("a", "c") ) w3 <- which( genotype %in% c("b", "c") ) list( ab = rowttes

[R] subsetting of factor

2008-09-11 Thread Hui-Yi Chu
Dear R list, I think my question maybe easy for you but I really spent entire day to resolve it. Say I have a matrix, rows are 6000 genes, columns(1-6) are 3 genotypes (a,b,c) with 2 repeat. I have to use two groups each time for t-test, a vs. c or b vs. c, but I dont know how to write correct cod