validate_positive: Validate positive values

View source: R/11.0-core-validators.R

validate_positiveR Documentation

Validate positive values

Description

Specialized validator for positive numeric values.

Usage

validate_positive(value, param_name, strategy = "strict", min_val = 0.001)

Arguments

value

Value(s) to validate

param_name

Parameter name

strategy

Handling strategy

min_val

Minimum positive value (default 0.001)

Value

An object of class fb4_validation (see validation_result). valid is TRUE when all values are \ge min_val. Violations are recorded in errors (strategy = "strict") or warnings (strategy = "warn").

Examples

validate_positive(5, "weight")
validate_positive(0, "weight")$valid

fb4package documentation built on May 8, 2026, 1:07 a.m.