[R] colnames and get means for the columns with the same names

2006-11-06 Thread Weiwei Shi
hi, I have a conversion table for colnames like this: Probe_ID HUMAN_LLID 1 AF106325_PROBE1 7052 2 NM_019386_PROBE1 7052 3 NM_012907_PROBE1339 4 AW917796_PROBE1 84196 5L27651_PROBE1 10864 The Probe_ID contains a list of colnames for another

Re: [R] colnames

2005-07-21 Thread Gilbert Wu
to get the elapsed time etc? Many Thanks indeed. Regards, Gilbert -Original Message- From: Adaikalavan Ramasamy [mailto:[EMAIL PROTECTED] Sent: 19 July 2005 23:38 To: Gilbert Wu Cc: r-help@stat.math.ethz.ch Subject: RE: [R] colnames What does class(r1) give you ? If it is data.frame

Re: [R] colnames

2005-07-21 Thread Adaikalavan Ramasamy
@stat.math.ethz.ch Subject: RE: [R] colnames What does class(r1) give you ? If it is data.frame, then try exp( diff( log( as.matrix( df ) ) ) ) BTW, I made the assumption that both x and y are positive values only. Regards, Adai On Tue, 2005-07-19 at 16:30 +0100, Gilbert Wu

Re: [R] colnames

2005-07-20 Thread Adaikalavan Ramasamy
Subject: RE: [R] colnames First, your problem could be boiled down to the following example. See how the colnames of the two outputs vary. df - cbind.data.frame( 100=1:2, 200=3:4 ) df/df X100 X200 111 211 m - as.matrix( df ) # coerce to matrix class m/m 100

Re: [R] colnames

2005-07-19 Thread Gilbert Wu
Hi Adai, Many Thanks for the examples. I work for a financial institution. We are exploring R as a tool to implement our portfolio optimization strategies. Hence, R is still a new language to us. The script I wrote tried to make a returns matrix from the daily return indices extracted from a

Re: [R] colnames

2005-07-19 Thread Adaikalavan Ramasamy
First, your problem could be boiled down to the following example. See how the colnames of the two outputs vary. df - cbind.data.frame( 100=1:2, 200=3:4 ) df/df X100 X200 111 211 m - as.matrix( df ) # coerce to matrix class m/m 100 200 1 1 1 2 1 1 It appears that

Re: [R] colnames

2005-07-19 Thread Prof Brian Ripley
On Tue, 19 Jul 2005, Adaikalavan Ramasamy wrote: First, your problem could be boiled down to the following example. See how the colnames of the two outputs vary. df - cbind.data.frame( 100=1:2, 200=3:4 ) df/df X100 X200 111 211 That one is probably unintentional. m -

Re: [R] colnames

2005-07-19 Thread Gilbert Wu
To: Gilbert Wu Cc: r-help@stat.math.ethz.ch Subject: RE: [R] colnames First, your problem could be boiled down to the following example. See how the colnames of the two outputs vary. df - cbind.data.frame( 100=1:2, 200=3:4 ) df/df X100 X200 111 211 m - as.matrix( df ) # coerce

Re: [R] colnames

2005-07-19 Thread Gilbert Wu
Cc: r-help@stat.math.ethz.ch Subject: RE: [R] colnames First, your problem could be boiled down to the following example. See how the colnames of the two outputs vary. df - cbind.data.frame( 100=1:2, 200=3:4 ) df/df X100 X200 111 211 m - as.matrix( df ) # coerce to matrix

[R] colnames

2005-07-18 Thread Gilbert Wu
Hi, I have a matrix with column names starting with a character in [0-9]. After some matrix operations (e.g. copy to another matrix), R seems to add a character 'X' in front of the column name. Is this a normal default behaviour of R? Why has it got this behaviour? Can it be changed? What

Re: [R] colnames

2005-07-18 Thread Adaikalavan Ramasamy
This normally happens to me when I read in a table where the rownames will be appended by an X. Read help(make.names) for more information. Remember that R is primarily a statistical software and thus likes colnames classes to be characters. mat1 - matrix( 1:12, nc=3, dimnames=list(NULL,

[R] colnames from submatrix?

2003-10-13 Thread Jeff D. Hamann
Hi R-Wizards: I've looking through the R docs and have yet to find what I'm looking for and have tried a few intermediate steps to now avail yet and rather than spend another few hours looking for the solution, I figured I would post a message. I have a matrix (actually a set of them) that I

Re: [R] colnames from submatrix?

2003-10-13 Thread Spencer Graves
Does the following meet your requirements: DF - data.frame(a=1:2, b=c(0,0)) DFzeros - sapply(DF, function(x)all(x==0)) names(DF)[!DFzeros] [1] a hope this helps. spencer graves Jeff D. Hamann wrote: Hi R-Wizards: I've looking through the R docs and have yet to find what I'm looking for

RE: [R] colnames from submatrix?

2003-10-13 Thread Liaw, Andy
many non-zero elements are in the columns. You just want columns with at least one non-zero entry. HTH, Andy -Original Message- From: Jeff D. Hamann [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 12:22 PM To: [EMAIL PROTECTED] Subject: [R] colnames from submatrix? Hi R