Computation on empty vectors: notes - lmmx/devnotes GitHub Wiki

!all(!as.logical(rmarkdown::metadata$potentially.absent.variable)
# ==> FALSE if potentially.absent.variable is absent
# ==> FALSE if anything other than TRUE
# ==> TRUE if TRUE

checkFor <- function(var) {
  return !all(!as.logical(rmarkdown::metadata[var](/lmmx/devnotes/wiki/var))
}