check_numeric: Check Numeric Values

View source: R/check_helpers.R

check_numericR Documentation

Check Numeric Values

Description

This function checks a numeric vector for invalid values. It identifies indices of elements that are infinite, negative, NA (if not allowed), or zero (if not allowed). It is used internally in the package to validate numeric columns that are expected to contain valid non-negative numbers.

Usage

check_numeric(col, allow_na = FALSE, allow_zero = FALSE)

Arguments

col

a numeric vector to be checked for invalid values.

allow_na

logical value indicating whether NA values are allowed. Default is FALSE.

allow_zero

logical value indicating whether zero values are allowed. Default is FALSE.

Value

a vector of indices where the numeric values are invalid (i.e., infinite, negative, NA, or zero if not allowed).


piavat/PRE2DUP-R documentation built on June 11, 2025, 11:42 a.m.