Learn R Programming

fb4package (version 2.0.0)

validate_positive: Validate positive values

Description

Specialized validator for positive numeric values.

Usage

validate_positive(value, param_name, strategy = "strict", min_val = 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").

Arguments

value

Value(s) to validate

param_name

Parameter name

strategy

Handling strategy

min_val

Minimum positive value (default 0.001)

Examples

Run this code
validate_positive(5, "weight")
validate_positive(0, "weight")$valid

Run the code above in your browser using DataLab