I received this error message:
Error in if (condition) { : missing value where TRUE/FALSE needed
or
Error in while (conditi
I ran into this when checking on a null or empty string
if (x == NULL || x == '') {
changed it to
if (is.null(x) || x == '') {