Generating a logical vector (1)

  • either by doing (vectorized) comparisons

    operators:

    • one-to-one: ==, !=, <, <=, >, >=
    • one-to-many: %in%


    Comparisons are often the way that logical vectors arise, i.e. during exploration, cleaning and analysis

    • … unless the logical vector is already provided, e.g. the observed variable is boolean.