Learn R Programming

fb4package (version 2.0.0)

validate_numeric_core: Core numeric validation with flexible handling strategies

Description

Atomic validator for numeric values with support for different handling strategies for problematic values. Used as foundation for other numeric validation functions.

Usage

validate_numeric_core(
  value,
  param_name,
  required = TRUE,
  allow_na = FALSE,
  allow_infinite = FALSE,
  min_val = NULL,
  max_val = NULL,
  strategy = "strict",
  default_value = NULL,
  integer_only = FALSE
)

Value

Validation result with potentially modified value

Arguments

value

Value(s) to validate

param_name

Parameter name for error messages

required

Whether the parameter is required (cannot be NULL)

allow_na

Whether NA values are allowed

allow_infinite

Whether infinite values are allowed

min_val

Minimum allowed value (optional)

max_val

Maximum allowed value (optional)

strategy

Handling strategy: "strict", "clamp", "replace", "warn"

default_value

Default value for "replace" strategy

integer_only

Whether value must be integer