Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_cause

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


assertive.base

A Lightweight Core of the 'assertive' Package

v0.0-9
GPL (>= 3)
Authors
Richard Cotton [aut, cre], Sunkyu Choi [trl], Ivanka Skakun [trl], Gergely Dar<c3><b3>czi [trl], Anton Antonov [trl], Hisham Ben Hamidane [trl], Anja Billing [trl], Aditya Bhagwat [trl], Rasmus B<c3><a5><c3><a5>th [trl], Mine Cetinkaya-Rundel [trl], Aspasia Chatziefthymiou [trl]
Initial release
2021-02-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.