I received the error
Error in if (condition) { : argument is of length zero
or
Error in while (condition) { : argument is of length zero
What causes this error message, and what does it mean?
On further inspection it seems that the value is NULL.
condition
## NULL
In order to deal with this error, how do I test for NULL values?
I expected that this would return TRUE, but I got an empty logical value:
condition == NULL
## logical(0)
See
?NULLYou have to use
is.nullTry this:
From section 2.1.6 of the R Language Definition