[R] name ONLY one column
    Pedersen Jon 
    Jon.Pedersen at fafo.no
       
    Mon Sep 27 16:53:39 CEST 2010
    
    
  
Hi,
It is because the column names do not exist. If you cast the matrix as a
data frame your code would work.
jon
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Lorenzo Cattarino
Sent: 27. september 2010 10:27
To: r-help at r-project.org
Subject: [R] name ONLY one column
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]]
______________________________________________
R-help at 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.
    
    
More information about the R-help
mailing list