[R] Individual rename of list items

Dieter Menne dieter.menne at menne-biomed.de
Thu Mar 1 12:30:20 CET 2001


I am confused by the logic of renaming:

# Rename individual list items?

Empl<-list(employee="Anna",spouse="Fred")
names(Empl)<-c("empl","spo")
names(Empl)
#[1] "empl" "spo"
# worked like a charm... but

names(Empl[1])<-"newempl"
# no error message, yet ....
names(Empl)
#[1] "empl" "spo"
# where's my newempl???????


If this line

  names(Empl[1])<-"newempl"

was stupid, why is there no error message?

---------------------------------------
Dr. Dieter Menne
Biomed Software
72074 Tübingen
Tel (49) (7071) 52176
FAX (49) (7071) 55 10 46
dieter.menne at menne-biomed.de
www.menne-biomed.de

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list