[R] if a variable is defined

Bill.Venables at csiro.au Bill.Venables at csiro.au
Fri Feb 11 03:18:32 CET 2011


!is.null(my.object at my.data.frame$my.var) 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Kushan Thakkar
Sent: Friday, 11 February 2011 10:30 AM
To: r-help at 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.object at my.data.frame) .. I want to check if one of the variables
exists in this data frame (i.e. my.object at 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.object at my.data.frame$my.var)
exists("my.object at my.data.frame$my.var")
exists("my.var",where="my.object at my.data.frame")

	[[alternative HTML version deleted]]

______________________________________________
R-help at 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.



More information about the R-help mailing list