[Rd] checking existence of active bindings
Martin Elff
elff at sowi.uni-mannheim.de
Sun Apr 1 15:32:10 CEST 2007
On Wednesday 28 March 2007 23:56, Tony Plate wrote:
> Is there any way to check whether an active binding exists without
> actually calling the active binding? I'd like to be able to do
> something like exists("x", ...) and know whether "x" exists without
> actually fetching its value if it is an active binding (because it could
> consume significant resources to fetch the value).
>
> > exists("x", inherits=FALSE)
>
> getting x1
> [1] TRUE
>
As you most probably found out for yourself - this works
as intended.
> "x" %in% ls(globalenv())
[1] TRUE
Best,
Martin
More information about the R-devel
mailing list