isUndefined function

Tell if a string is undefined (NA or NULL); If yes, and its required by the mzQC standard, we can raise an error.

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)

Arguments

  • s: A string to be checked for NA/NULL
  • ...: More strings to be checked
  • verbose: If TRUE and 's' is NULL/NA, will print the name of the variable which was passed in

Examples

isUndefined(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!"
  • Maintainer: Chris Bielow
  • License: MIT + file LICENSE
  • Last published: 2025-03-23