Define a goalie check classed return
Arguments
- object
logical
.
- cause
character
.
Only applies when object
vector contains any FALSE
values.
The cause
attribute must be named.
Cause values corresponding to TRUE
must be set NA
.
Value
All TRUE
: logical
.
Any FALSE
: goalie
, which extends logical
.
Examples
## Any FALSE.
x <- goalie(
object = c(FALSE, TRUE),
cause = c("xxx", NA_character_)
)
print(x)
#> [1] FALSE TRUE
print(cause(x))
#> [1] "xxx" NA
## All TRUE.
x <- goalie(rep(TRUE, 2L))
print(x)
#> [1] TRUE TRUE