Summarizing logical vectors (1)

  • Summarizing the whole vector:
    • any(), all(): return a logical
    • sum(), mean(): return a numeric
  • Summarizing a subset:
    • apply a summary function to a subsetted vector
  • If NA values are present, the summary result will be NA, BUT the NA values can also be ignored with: na.rm = TRUE.