check_logical_scalar: Check logical scalar

View source: R/check.R

check_logical_scalarR Documentation

Check logical scalar

Description

Check logical scalar

Usage

check_logical_scalar(x, arg_name = deparse(substitute(x)))

Arguments

x

Logical: Value to check. Must be a single non-NA TRUE or FALSE.

arg_name

Character: Argument name to use in error messages.

Value

Called for side effects. Throws an error if checks fail.

Author(s)

EDG

Examples

check_logical_scalar(TRUE)
check_logical_scalar(FALSE)
# Throw error:
try(check_logical_scalar(NA))
try(check_logical_scalar(1L))
try(check_logical_scalar(c(TRUE, FALSE)))

rtemis.core documentation built on Sept. 20, 2026, 9:06 a.m.