Exercise 4-6
cumsum(x)andcumsum(!x)can be used to test if any ‘x’ isTRUEorFALSEcumprod(x)andcumprod(!x)can be used to test if any ‘x’ isTRUEorFALSEIn each case, the logical elements are automatically coerced into zeroes and ones.
Does this use of cumsum(), etc. have any practical use vs. using
isTrue(x)orTRUE %in% x, etc?