[Rd] row.names, rownames; colnames, no col.names?
Peter Dalgaard BSA
12 Dec 2000 00:35:12 +0100
firstname.lastname@example.org (A.J. Rossini) writes:
> There's a bit of a symmetry issue, which may or may not be important
> (led to 15 seconds of confusion until I got my bearings straight):
> row.names, rownames; colnames, no col.names?
> I _NOW_ realize the difference between row.names and rownames, but
> is there any reason not to have col.names for re-naming columns in a
> (if there is, I don't particular need to know it, but it might make a
> nice FAQ).
Well, plain names()<- will do fine, colnames()<- will as well. Data
frames have an attribute called "row.names", and hence it makes sense
to have an extractor function of the same name, but there is no
"col.names" attribute. (However, why we chose to have "rownames" and
"colnames" without dots escapes me for the moments. They go back to
before we had the data frame code, and I suspect it is mostly a
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (email@example.com) FAX: (+45) 35327907
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: firstname.lastname@example.org