Generating a logical vector (7)

  • either by doing (vectorized) comparisons (see before)

  • or by combining logical vectors or comparisons = boolean algebra

    • operators: &, |, !, xor()
    • {magrittr} (through {dplyr}) provides the aliases and(), or(), not()


    In numerical operations, FALSE is 0 and TRUE is 1. Therefore:

    • & can be mimicked by pmin()
    • | can be mimicked by pmax()