set_cause: Set a cause and return the input

Description Usage Arguments Details Value See Also

View source: R/cause.R

Description

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

Usage

1
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


assertive.base documentation built on Feb. 8, 2021, 9:06 a.m.