Tell if a string is undefined (NA or NULL); If yes, and its required by the mzQC standard, we can raise an error.
You can pass multiple strings, which are all checked. If any of them is undefined, the function returns TRUE
isUndefined(s, ..., verbose = TRUE)
s
: A string to be checked for NA/NULL...
: More strings to be checkedverbose
: If TRUE and 's' is NULL/NA, will print the name of the variable which was passed inisUndefined(NA) ## TRUE isUndefined(NULL) ## TRUE isUndefined(NA, NULL) ## TRUE isUndefined("") ## FALSE isUndefined("", NA) ## TRUE isUndefined(NA, "") ## TRUE isUndefined(1) ## FALSE myVar = NA isUndefined(myVar) ## TRUE, with warning "Variable 'myVar' is NA/NULL!"