Checks that an argument is a single non-missing TRUE or
FALSE. Meant for the many switches in the suite -
correct, unbiased, scaled, paired and the
like - which were previously either unchecked or checked in three
different ways.
Usage
checkFlag(x, name = deparse(substitute(x)))Details
NA is rejected on purpose. It is a logical of length one and
therefore passes is.logical(), but a flag that is neither on nor
off has no meaning for a switch - and it propagates silently, because
if (NA) is an error somewhere further down rather than here.
