Validate input with type/length constraints

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