[R] how to determine if a variable is already set?

Michael Knudsen micknudsen at gmail.com
Sun Sep 13 16:06:10 CEST 2009


On Fri, Sep 11, 2009 at 7:15 PM, carol white <wht_crl at yahoo.com> wrote:

> It might be a primitive question but how it is possible to determine if a variable is initialized in an environment?

What about this?

> "x" %in% ls()
[1] FALSE
> x = 41
> "x" %in% ls()
[1] TRUE

Best,
Michael

-- 
Michael Knudsen
micknudsen at gmail.com
http://lifeofknudsen.blogspot.com/




More information about the R-help mailing list