Hi,

I'm not sure it's even possible (and if it is I don't know how, but I'm 
no expert).

But I think it doesn't make much sense to have only one named column. 
Just give it a vector:
vect_names <- c("myname1", "myname2", "myname3")
colnames(my_matrix) <- vect_names

HTH,
Ivan


Le 9/27/2010 10:26, Lorenzo Cattarino a écrit :
> Hi R-users
>
>
>
> I can not change the name of one column only of my matrix.
>
>
>
> my_matrix<- matrix (1:12,ncol=3)
>
>
>
> colnames(my_matrix)[1]<- 'myname'
>
>
>
> Error in dimnames(x)<- dn :
>
>    length of 'dimnames' [2] not equal to array extent
>
>
>
> thank you for your help
>
>
>
> Lorenzo
>
>
>       [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] 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.
>

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
[email protected]

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php


        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to