[R] Changing Matrix Header

Gundala Viswanath gundalav at gmail.com
Tue Jan 6 09:14:19 CET 2009


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




More information about the R-help mailing list