[R] getAnywhere

Bastian A. bastianra at gmail.com
Wed Oct 15 00:02:42 CEST 2008


Hi List,

I am trying to look up an object using getAnywhere, where the object I
am looking for is given by the _value_ of the variable I am looking
for. Since getAnywhere calls substitue on its argument it is looking
for an object with the name of the argument not its value. Is there a
way to work around this, or do I have to make my own getAnywhere
without the substitute?

This is an example to clarify things:
> a <- 1
> name = "a"
> getAnywhere(name) # the intend here is to find the object a with value 1 not the object name with value a
A single object matching 'name' was found
It was found in the following places
  .GlobalEnv
with value

[1] "a" # I'd like to see a 1 here the value of a



Regards,
Bastian



More information about the R-help mailing list