Evaluating strings as variables
Matthias.Kohl at uni-bayreuth.de writes:
sapply(colors, get)
or? unlist(mget(colors, envir = as.environment(-1), inherits = TRUE))
Ah, yes, forgot about mget. Doesn't seem to make things much cleaner though... (although get() also needs a bit more care about environments).
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907