Skip to contents

Assert that an input is a single finite numeric value

Usage

.assert_scalar_numeric(x, arg)

Arguments

x

The input to check.

arg

The name of the argument being checked, used in error messages.

Value

Invisibly returns NULL if the check passes. Otherwise, throws an error.

Details

This function is used internally to validate that certain inputs are single numeric values that are not NA or infinite. It checks that x is numeric, has length 1, and is not NA or infinite. If any of these conditions fail, an informative error message is thrown indicating the argument name and the nature of the issue.