check_prob_vector: Check probability vector

View source: R/check.R

check_prob_vectorR Documentation

Check probability vector

Description

Check probability vector

Usage

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

Arguments

x

Numeric: Value to check. Must be a non-empty vector with all elements in [0, 1] and no NAs.

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_vector(c(0, 0.5, 1))
# Throw error:
try(check_prob_vector(c(0.5, 1.5)))
try(check_prob_vector(c(0.5, NA)))

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