Is there a function like "is.there" such that is.there ( a ) returns TRUE is object 'a' is in the current environment and FALSE otherwise? Thank you. Francisco J. Molina
On Fri, 2004-01-30 at 14:58, Francisco J Molina wrote:> Is there a function like "is.there" such that > > is.there ( a ) returns TRUE is object 'a' is in the current environment and > FALSE otherwise? > > Thank you. > Francisco J. MolinaSee ?exists This requires that the object of interest is quoted:> a <- "I am here" > exists(a)[1] FALSE> exists("a")[1] TRUE There are other arguments to the function to indicate where to search, etc. HTH, Marc Schwartz
> Is there a function like "is.there" such that > is.there ( a ) returns TRUE is object 'a' is in the current environment and > FALSE otherwise?exists()
try the function exists() On Fri, 30 Jan 2004, Francisco J Molina wrote:> > Is there a function like "is.there" such that > > is.there ( a ) returns TRUE is object 'a' is in the current environment and > FALSE otherwise? > > Thank you. > Francisco J. Molina > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >Paulo Justiniano Ribeiro Jr Departamento de Estat?stica Universidade Federal do Paran? Caixa Postal 19.081 CEP 81.531-990 Curitiba, PR - Brasil Tel: (+55) 41 361 3471 Fax: (+55) 41 361 3141 e-mail: pj at est.ufpr.br http://www.est.ufpr.br/~paulojus
Have you considered "exists" or "missing"? hope this helps. spencer graves Francisco J Molina wrote:>Is there a function like "is.there" such that > >is.there ( a ) returns TRUE is object 'a' is in the current environment and >FALSE otherwise? > >Thank you. >Francisco J. Molina > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >
Francisco J Molina wrote:> Is there a function like "is.there" such that > > is.there ( a ) returns TRUE is object 'a' is in the current environment and > FALSE otherwise??exists -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894
On 30 Jan 2004 at 12:58, Francisco J Molina wrote:> > Is there a function like "is.there" such that > > is.there ( a ) returns TRUE is object 'a' is in the current > environment and FALSE otherwise?Have you tried exists("a", inherits=FALSE) ? - Torsten
Francisco J Molina <fjmolina at ams.ucsc.edu> writes:> Is there a function like "is.there" such that > > is.there ( a ) returns TRUE is object 'a' is in the current environment and > FALSE otherwise?exists("a",inherits=FALSE) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907