validate_positive {catalytic} | R Documentation |
Validate Positive or Non-negative Parameter
Description
This function checks whether a parameter value is positive (or non-negative if incl_0
is set to TRUE
).
It can handle both single numeric values and vectors, and it raises an error with an informative
message if the validation fails.
Usage
validate_positive(param_name, param_value, incl_0 = FALSE, is_vector = FALSE)
Arguments
param_name |
A string representing the name of the parameter. Used in the error message. |
param_value |
The parameter value to validate, either a single numeric or a numeric vector. |
incl_0 |
Logical, if |
is_vector |
Logical, if |
Value
NULL
if validation passes; otherwise, an error is raised.
[Package catalytic version 0.1.0 Index]