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:
> [,
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
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
Cheers, Si.
- Original Message -
From: "Gundala Viswanath"
To:
Sent: Tuesday, January 06, 2009 8:14 AM
Subject: [R] Changing Matrix Header
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
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:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 0 0 0 0
5 matches
Mail list logo