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 <gundalav@gmail.com>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:
>         [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]   [,9]   [,10]
>    [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
>
>
> I tried:
>
> > as.matrix(x)
>
> But failed.
>
>
> - Gundala Viswanath
> Jakarta - Indonesia
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]


