validate_param: Common validation utility for bidux functions (DRY principle)

View source: R/utils_validation.R

validate_paramR Documentation

Common validation utility for bidux functions (DRY principle)

Description

Centralized parameter validation to reduce code duplication

Usage

validate_param(
  value,
  arg_name,
  type = "character",
  min_length = 1,
  max_length = Inf,
  allow_na = FALSE,
  choices = NULL
)

Arguments

value

The value to validate

arg_name

The argument name for error messages

type

Expected type: "character", "logical", "numeric"

min_length

Minimum length for vectors

max_length

Maximum length for vectors

allow_na

Whether NA values are allowed

choices

Valid choices for character parameters


bidux documentation built on Nov. 20, 2025, 1:06 a.m.