is_non_negative_numeric: Check if a Number is a Non-Negative Numeric

View source: R/is_non_negative_numeric.R

is_non_negative_numericR Documentation

Check if a Number is a Non-Negative Numeric

Description

This internal function checks whether the input is a non-negative numeric scalar. It can optionally throw an error if the input is invalid.

Usage

is_non_negative_numeric(x, name_of_func, throw_error = TRUE)

Arguments

x

The input to check. Should be a single numeric value.

name_of_func

Name of function to return as error message

throw_error

Logical. If TRUE, the function throws an error when the input is invalid. Defaults to FALSE, in which case the function returns FALSE for invalid inputs.

Details

This function is intended for internal use within the package to validate numeric inputs. It ensures that the input is numeric, has a length of 1, and is greater than 0.

Value

A logical value:

  • TRUE if x is a non-negative numeric scalar.

  • FALSE if x is not a non-negative numeric scalar'.


pdfcombiner documentation built on Sept. 9, 2025, 5:56 p.m.