Sets the cause attribute of an object and returns that object.
set_cause(x, false_value, missing_value = "missing")
A variable.
A character vector to set the cause to, where x
is
FALSE
.
A character vector to set the cause to, where x
is
NA
.
x
, with a new cause attribute.
If x
is TRUE
everywhere, this returns the input
without setting a cause. Otherwise, the cause is an empty string where
x
is TRUE
, false_value
where it is FALSE
, and
missing_value
where it is NA
.