[Rd] R-devel: rownames of a data.frame

From: Gregor Gorjanc <gregor.gorjanc_at_bfro.uni-lj.si>
Date: Thu 14 Sep 2006 - 05:52:18 GMT


Hello!

Data.frames have new rownames funcionality, however in use of colnames<- in R-devel "changes" this. Here is the example:

> df1 <- data.frame(letters[1:5])
> attributes(df1)

$names
[1] "letters.1.5."

$row.names
[1] 1 2 3 4 5

$class
[1] "data.frame"

> colnames(df1) <- "bla"
> attributes(df1)

$names
[1] "bla"

$row.names
[1] "1" "2" "3" "4" "5"

$class
[1] "data.frame"

?rownames/colnames help page (R-devel) says that value is coerced to character, but why are rownames coerced to character if I assign colnames to a data.frame?

-- 
Lep pozdrav / With regards,
    Gregor Gorjanc

----------------------------------------------------------------------
University of Ljubljana     PhD student
Biotechnical Faculty
Zootechnical Department     URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3                   mail: gregor.gorjanc <at> bfro.uni-lj.si

SI-1230 Domzale             tel: +386 (0)1 72 17 861
Slovenia, Europe            fax: +386 (0)1 72 17 888

----------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Sep 14 15:53:30 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 06 Dec 2006 - 05:30:51 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.