Skip to content
Prev 177260 / 398502 Next

get() versus getAnywhere()

On 4/16/2009 9:52 AM, Benjamin Tyner wrote:
It's not a bug.  getAnywhere doesn't really mean "anywhere", it means 
"visible on the search path, registered as an S3 method or in a name 
space but not exported."  On the other hand, the browser will show you 
the local evaluation frame.  So I'd expect the browser to be able to see 
x below, but getAnywhere wouldn't find it, because it's not in one of 
the places listed above.

f <- function(x) {
   browser()
   getAnywhere("x")
}

f(1)