Skip to contents

Define a goalie check classed return

Usage

goalie(object, cause)

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.

Note

Updated 2023-09-29.

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