What are you trying to do with that?  Most times when someone asks this
question, they are trying to accomplish something that can be done
better a different way, so if you tell us what you are trying to
accomplish, we can suggest better approaches.

The short answer to your question is ?get.  

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Bobby Prill
> Sent: Friday, April 27, 2007 2:35 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] how to evaluate a dynamic variable?
> 
> Please help me evaluate a "dynamic variable" as show in the 
> code snippet below.
> 
> # regular variable
> a = c(1,2,3,4)
> 
> # dynamic variable set at runtime
> DV = "a"
> 
> eval(DV)
> --> a
> 
> eval(eval(DV))
> --> a
> 
> # what I want
> something_goes_here(DV)
> -->  1,2,3,4
> 
> Can someone teach me how to do this?  Thanks very much.
> 
> - Bobby
> 
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to