From thomas@biostat.washington.edu  Thu Mar 11 17:10:03 1999
From: thomas@biostat.washington.edu (thomas@biostat.washington.edu)
Date: Thu, 11 Mar 1999 18:10:03 +0100
Subject: exists finds objects lots of places! (PR#142)
Message-ID: <199903111710.SAA14188@biostat.ku.dk>

On Thu, 11 Mar 1999 oncley@ucar.edu wrote:

> Full_Name: Steve Oncley
> Version: 0.63.3
> OS: Redhat5.2 i386 
> Submission from: 128.117.80.159 (128.117.80.159)
> 
> 
> "exists" finds object UP TO the position it is in


> whereas, S+ only finds the one position where the object is:

"It's not a bug, it's a feature"

R> args(exists)
function (x, where = -1, envir = pos.to.env(where), frame, mode = "any", 
    inherits = TRUE) 

You need to use inherits=F to search only the specified position.>
R> search()
[1] ".GlobalEnv"   "Autoloads"    "package:base"
R> exists("ls",2)
[1] TRUE 
R> exists("ls",2,inherits=F)
[1] FALSE


Thomas Lumley
Assistant Professor,Biostatistics
University of Washington, Seattle



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


exists finds objects lots of places! (PR#142)
thomas@biostat.washington.edu