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> search()[1] ".GlobalEnv" "Autoloads" "package:base"> exists("ls",1)[1] TRUE> exists("ls",2)[1] TRUE> exists("ls",3)[1] TRUE> x <- 1 > exists("x",1)[1] TRUE> exists("x",2)[1] FALSE> exists("x",3)[1] FALSE whereas, S+ only finds the one position where the object is:> search()[1] ".Data" [2] "/net/aster/splus3.4/local/.Data" [3] "/net/aster/splus3.4/splus/.Functions" [4] "/net/aster/splus3.4/stat/.Functions" [5] "/net/aster/splus3.4/s/.Functions" [6] "/net/aster/splus3.4/s/.Datasets" [7] "/net/aster/splus3.4/stat/.Datasets" [8] "/net/aster/splus3.4/splus/.Datasets" [9] "/net/aster/splus3.4/library/Matrix/.Data" [10] "/net/aster/splus3.4/library/trellis/.Data"> exists("ls",1)[1] F> exists("ls",2)[1] F> exists("ls",3)[1] F> exists("ls",4)[1] F> exists("ls",5)[1] T> exists("ls",6)[1] F -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
thomas@biostat.washington.edu
1999-Mar-11 17:10 UTC
exists finds objects lots of places! (PR#142)
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._