check_prob_scalar: Check probability scalar

View source: R/check.R

check_prob_scalarR Documentation

Check probability scalar

Description

Check probability scalar

Usage

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

Arguments

x

Numeric: Value to check. Must be a single finite number in [0, 1].

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_prob_scalar(0)
check_prob_scalar(0.5)
check_prob_scalar(1)
# Throw error:
try(check_prob_scalar(1.5))
try(check_prob_scalar(-0.1))

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