Skip to content

Computation on empty vectors: notes

Louis edited this page Mar 4, 2015 · 5 revisions
!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]])
}
Clone this wiki locally