Learn R Programming

yulab.utils (version 0.2.3)

check_input: 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"
)

Value

Invisible TRUE on success

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

See Also

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