[R] Testing if an object exists

Gavin.Kennedy@csiro.au Gavin.Kennedy at csiro.au
Sun Jan 27 05:16:17 CET 2002


Is it possible to test if an object exists without using the object name?

For example I have a function with scanid as a variable. I want to test for
the attributes of that object, but if the object has 
not already been defined I will get an error 'Object "SC000027" not found'
where SC000027 is the scanid. So can I 
check if the object exists or not before attempting any operations on it. I
know I can use exists() but I am want to avoid 
having to pass the object name as an argument.

Thanks for your help.

Gavin Kennedy
Software Engineer - Bioinformatics
CSIRO Mathematical and Information Sciences
Gavin.Kennedy at CSIRO.AU

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list