Learn R Programming

yulab.utils (version 0.2.2)

check_range: Check if value is within specified range

Description

Validates that a numeric value falls within the specified range

Usage

check_range(x, min = NULL, max = NULL, inclusive = TRUE, arg_name = "value")

Value

Invisible TRUE if valid, throws error otherwise

Arguments

x

Numeric value to check

min

Minimum allowed value (optional)

max

Maximum allowed value (optional)

inclusive

Whether bounds are inclusive (default: TRUE)

arg_name

Name of the argument for error messages