Re: [R] Prefix for colnames

2005-07-20 Thread Prof Brian Ripley
On Wed, 20 Jul 2005 [EMAIL PROTECTED] wrote: > > Hi, > > I would like to add a prefix to colnames in a matrix but I can't get the > prefix > option in colnames to work. What am I doing wrong? > >> X<-matrix(NA,3,4) >> colnames(X)<-c("test","test","test","test") >> colnames(X)<-colnames(X,prefix="

Re: [R] Prefix for colnames

2005-07-20 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: > Hi, > > I would like to add a prefix to colnames in a matrix but I can't get the > prefix > option in colnames to work. What am I doing wrong? > > > X<-matrix(NA,3,4) > > colnames(X)<-c("test","test","test","test") > > colnames(X)<-colnames(X,prefix="PREFIX.") > > X

Re: [R] Prefix for colnames

2005-07-20 Thread Duncan Murdoch
On 7/20/2005 9:54 AM, [EMAIL PROTECTED] wrote: > Hi, > > I would like to add a prefix to colnames in a matrix but I can't get the > prefix > option in colnames to work. What am I doing wrong? The prefix argument is only used when there are no names and colnames is generating some. You just wan

[R] Prefix for colnames

2005-07-20 Thread jhainm
Hi, I would like to add a prefix to colnames in a matrix but I can't get the prefix option in colnames to work. What am I doing wrong? > X<-matrix(NA,3,4) > colnames(X)<-c("test","test","test","test") > colnames(X)<-colnames(X,prefix="PREFIX.") > X test test test test [1,] NA NA NA