!is.null(my.obj...@my.data.frame$my.var) -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Kushan Thakkar Sent: Friday, 11 February 2011 10:30 AM To: r-help@r-project.org Subject: [R] if a variable is defined
I have an object type my.object. One of its slots contains a data frame (i.e. my.obj...@my.data.frame) .. I want to check if one of the variables exists in this data frame (i.e. my.obj...@my.data.frame$my.var) I am trying to use the exists function but can't figure out how the arguments work. Please help. So far I have tried exists(my.obj...@my.data.frame$my.var) exists("my.obj...@my.data.frame$my.var") exists("my.var",where="my.obj...@my.data.frame") [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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. ______________________________________________ R-help@r-project.org mailing list 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.