Quotation marks help also for exists():
exists( "meanedf" )
[1] TRUE
On Saturday 07 November 2015 04:48:04 Margaret Donald wrote:
> 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
For me,
"meanedf" %in% ls()
works:
meanedf <- 1
"meanedf" %in% ls()
[1] TRUE
rm( meanedf )
"meanedf" %in% ls()
[1] FALSE
Rgds,
Rainer
On Saturday 07 November 2015 04:48:04 Margaret Donald wrote:
> I have a variable meanedf which may sometimes not be defined due to a
> complex set of circumst
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
3 matches
Mail list logo