set_cause {assertive.base}R Documentation

Set a cause and return the input

Description

Sets the cause attribute of an object and returns that object.

Usage

set_cause(x, false_value, missing_value = "missing")

Arguments

x

A variable.

false_value

A character vector to set the cause to, where x is FALSE.

missing_value

A character vector to set the cause to, where x is NA.

Details

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.

Value

x, with a new cause attribute.

See Also

cause, setNames


[Package assertive.base version 0.0-9 Index]