check_input: Validate input with type/length constraints

View source: R/error-utils.r

check_inputR Documentation

Validate input with type/length constraints

Description

Enhanced input validation supporting base types and class checks.

Usage

check_input(
  x,
  type = NULL,
  length = NULL,
  min_length = NULL,
  max_length = NULL,
  allow_null = FALSE,
  arg_name = "input"
)

Arguments

x

Object to check

type

Expected type (e.g., "numeric", "character", or class name)

length

Expected length

min_length

Minimum length

max_length

Maximum length

allow_null

Whether NULL is allowed

arg_name

Argument name for messages

Value

Invisible TRUE on success

See Also

Other validate-utils: check_directory(), check_file(), check_packages(), check_range()


yulab.utils documentation built on Feb. 5, 2026, 9:10 a.m.