Re: [R] Changing Matrix Header

2009-01-06 Thread Henrique Dallazuanna
Try this: unname(dat) On Tue, Jan 6, 2009 at 6:14 AM, Gundala Viswanath wrote: > Dear all, > > I have the following matrix. > > > dat > A A A A A A A A A A >[1,] 0 0 0 0 0 0 0 0 0 0 >[2,] 0 0 0 0 0 0 0 0 0 1 >[3,] 0 0 0 0 0 0 0 0 0 2 > > How can I change it into: > [,

Re: [R] Changing Matrix Header

2009-01-06 Thread Jorge Ivan Velez
Dear Gundala, Try this: # Original matrix set.seed(123) X=matrix(rnorm(100),ncol=10) colnames(X)<-paste('X',1:10,sep="") X # No headers colnames(X)<-NULL X HTH, Jorge On Tue, Jan 6, 2009 at 3:14 AM, Gundala Viswanath wrote: > Dear all, > > I have the following matrix. > > > dat > A A

Re: [R] Changing Matrix Header

2009-01-06 Thread Carlos J. Gil Bellosta
Hello, colnames( dat ) <- NULL will do the trick. Carlos J. Gil Bellosta http://www.datanalytics.com On Tue, 2009-01-06 at 17:14 +0900, Gundala Viswanath wrote: > Dear all, > > I have the following matrix. > > > dat > A A A A A A A A A A > [1,] 0 0 0 0 0 0 0 0 0 0 > [2,] 0 0

Re: [R] Changing Matrix Header

2009-01-06 Thread Simon Pickett
Hi Gundala, try chopping off the top row like newx<-as.matrix(x[2:dim(x)[1],]) OR try changing it to a data frame... new x<-data.frame(x,row.names=NULL) #pretty sure its not row.names but there is probably an equivalent for col.names OR look into ?read.table and specify header = F Cheers,