I have a variable meanedf which may sometimes not be defined due to a complex set of circumstances. I would like to be able to find out whether or not it exists, and then branch appropriately in my code.
I had hoped to be able to use is.null() or exists() but neither of these returns TRUE or FALSE which is the behaviour I would like, so that I can write some appropriate branching code. is.null(meanedf) Error: object 'meanedf' not found No suitable frames for recover() exists(meanedf) Error in exists(meanedf) : object 'meanedf' not found I would like some code which returns TRUE when meanedf exists and FALSE when it doesn't. Thanks, and regards, Margaret Donald -- Margaret Donald Post Doctoral researcher University of New South Wales margaret.don...@unsw.edu.au 0405 834 550 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.