check_integer_scalar: Validate a scalar integer parameter

View source: R/sim-utils.R

check_integer_scalarR Documentation

Validate a scalar integer parameter

Description

Checks that x is a single finite value coercible to integer and at least min.val. Used by forced-choice sim.data.* functions to validate N.person, N.block, I.block, and D.

Usage

check_integer_scalar(x, name, min.val = 1L)

Arguments

x

Value to check.

name

Parameter name (used in the error message).

min.val

Minimum allowed value (default 1L).

Value

as.integer(x) on success; raises an error otherwise.


ForceChoice documentation built on Sept. 13, 2026, 1:06 a.m.