checkIsBoolean {CASMAP} | R Documentation |
Checks if a variable is boolean, if not throws an error, otherwise returns boolean.
checkIsBoolean(var, name)
var |
The variable to be checked (if boolean). |
name |
The name of the variable to appear in any error message. |
If not boolean (or NA
), throws error.
If NA
, return FALSE
. Otherwise return
boolean value of var
.