[R] Fw: Evaluating strings as variables

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Jun 21 00:52:51 CEST 2004


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




More information about the R-help mailing list