check_float_neg1_1: Check float -1 <= x <= 1

View source: R/check.R

check_float_neg1_1R Documentation

Check float -1 <= x <= 1

Description

Check float -1 <= x <= 1

Usage

check_float_neg1_1(x, allow_null = TRUE, arg_name = deparse(substitute(x)))

Arguments

x

Numeric vector.

allow_null

Logical: If TRUE, NULL values are allowed and return early.

arg_name

Character: Name of the variable for error messages.

Value

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

Author(s)

EDG

Examples

check_float_neg1_1(c(-1, 0, 1))
# Throws error:
try(check_float_neg1_1(c(-1.5, 0, 1.5)))

rtemis.core documentation built on April 22, 2026, 1:11 a.m.