Learn R Programming

optconerrf (version 1.0.1)

.rangeCheck: Simple range check for numeric variables

Description

This function performs very basic range checks for numeric variables and throws an error if the range is violated. A custom hint may be added to the message.

Usage

.rangeCheck(variable, range, allowedEqual, hint = "")

Arguments

variable

The (named) variable to be checked.

range

A vector of length 2 giving the minimum and maximum of the allowed range.

allowedEqual

Logical. Are the borders of range valid values?

hint

Additional message that may be printed after the error.