Skip to content
Prev 23139 / 63424 Next

R-devel: rownames of a data.frame

Gregor Gorjanc <gregor.gorjanc <at> bfro.uni-lj.si> writes:
because  colnames() and rownames() work via dimnames(), and so do
 "colnames<-" and "rownames<-" ---  
I think it would be unwise to change this, since it's well documented property
of these functions.

As you noted yourself,  using  names() and "names<-"
i.e.,
  names(df1) <- "bla"
in the example above, is the recommended way for data frames and does not change
the rownames to character.