Re: [R] Problem with rowMeans()

2008-06-13 Thread Wacek Kusnierczyk
Erik Iverson wrote: > > > ss wrote: >> It is: >> >> > data <- >> read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', >> row.names = NULL ,header=TRUE, fill=TRUE) >> > class(data[3]) >> [1] "data.frame" >> > >> > > Oops, should have said class(data[[3]]) and > is.numeric(data[

Re: [R] Problem with rowMeans()

2008-06-12 Thread Erik Iverson
ss wrote: Thanks, Erik. I will try your code soon. I did this first: > data <- read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', row.names = NULL ,header=TRUE, fill=TRUE) > class(data[[3]]) [1] "factor" > is.numeric(data[[3]]) [1] FALSE > So it is not numeric but

Re: [R] Problem with rowMeans()

2008-06-12 Thread ss
Dear Erik and Wacek, I would request that you stop working on my problem. I had the second column deleted and the problem is gone. I don't know why but apparently the second column somehow interfered with the third column such that the third column is regarded as 'factor' not 'numeric'. I can rec

Re: [R] Problem with rowMeans()

2008-06-12 Thread ss
Thanks, Erik. I will try your code soon. I did this first: > data <- read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', row.names = NULL ,header=TRUE, fill=TRUE) > class(data[[3]]) [1] "factor" > is.numeric(data[[3]]) [1] FALSE > So it is not numeric but 'factor' instead. Can

Re: [R] Problem with rowMeans()

2008-06-12 Thread Erik Iverson
ss wrote: It is: > data <- read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', row.names = NULL ,header=TRUE, fill=TRUE) > class(data[3]) [1] "data.frame" > Oops, should have said class(data[[3]]) and is.numeric(data[[3]]) See ?Extract And if I try to use as.ma

Re: [R] Problem with rowMeans()

2008-06-12 Thread ss
It is: > data <- read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', row.names = NULL ,header=TRUE, fill=TRUE) > class(data[3]) [1] "data.frame" > And if I try to use as.matrix(read.table()), I got: >data <-as.matrix(read.table('E-TABM-1-processed-data-1342561271_log2_with_sy

Re: [R] Problem with rowMeans()

2008-06-12 Thread Erik Iverson
ss wrote: Hi Wacek, Yes, data is data frame not a matrix. is.numeric(data[3]) [1] FALSE what is class(data[3]) But I looked at the column 3 and it looks okay though. There are few NAs and I did find anything strange. Any suggestions? Thanks, Allen On Thu, Jun 12, 2008 at 7:0

Re: [R] Problem with rowMeans()

2008-06-12 Thread ss
Hi Wacek, Yes, data is data frame not a matrix. > is.numeric(data[3]) [1] FALSE But I looked at the column 3 and it looks okay though. There are few NAs and I did find anything strange. Any suggestions? Thanks, Allen On Thu, Jun 12, 2008 at 7:01 PM, Wacek Kusnierczyk < [EMAIL PROTECTE

Re: [R] Problem with rowMeans()

2008-06-12 Thread Wacek Kusnierczyk
ss wrote: > Thank you very much, Wacek! It works very well. > But there is a minor problem. I did the following: > > >data <- > read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', > +row.names = NULL ,header=TRUE, fill=TRUE) looks like you have a data frame, not a matrix > > d

Re: [R] Problem with rowMeans()

2008-06-12 Thread Erik Iverson
ss wrote: Dear Erik, Thanks! The 'data' is matrix but all(apply(data[,3:85], 2, class) == "numeric") is false. > class(data) [1] "matrix" > a<- rowMeans(data[,3:85],na.rm = TRUE) Error in rowMeans(data[, 3:85], na.rm = TRUE) : 'x' must be numeric > all(apply(data[,3:85], 2, class) == "nu

Re: [R] Problem with rowMeans()

2008-06-12 Thread Wacek Kusnierczyk
ss wrote: > Hi all, > > I have a matrix called 'data', which looks like: > > >> data[1:4,1:4] >> > Probe_ID Gene_Symbol M1601 M1602 > 1 A_23_P10586213CDNA73-1.60.16 > 2 A_23_P76435 15E1.20.180.59 > 3 A_24_P402

Re: [R] Problem with rowMeans()

2008-06-12 Thread ss
Dear Erik, Thanks! The 'data' is matrix but all(apply(data[,3:85], 2, class) == "numeric") is false. > class(data) [1] "matrix" > a<- rowMeans(data[,3:85],na.rm = TRUE) Error in rowMeans(data[, 3:85], na.rm = TRUE) : 'x' must be numeric > all(apply(data[,3:85], 2, class) == "numeric") [1] FALSE >

Re: [R] Problem with rowMeans()

2008-06-12 Thread Erik Iverson
Hello - ss wrote: Hi all, I have a matrix called 'data', which looks like: data[1:4,1:4] Probe_ID Gene_Symbol M1601 M1602 1 A_23_P10586213CDNA73-1.60.16 2 A_23_P76435 15E1.20.180.59 3 A_24_P402115 15E1.2

[R] Problem with rowMeans()

2008-06-12 Thread ss
Hi all, I have a matrix called 'data', which looks like: > data[1:4,1:4] Probe_ID Gene_Symbol M1601 M1602 1 A_23_P10586213CDNA73-1.60.16 2 A_23_P76435 15E1.20.180.59 3 A_24_P402115 15E1.21.63