checkRange1D: One-Dimensional Range Parameter Check

Description Usage Arguments Details Value

View source: R/utilities-input-validation.R

Description

Helper function for checkRange. Checks if a supplied range is an ordered pair. Coerces any vector of length two or greater into an ordered pair, and issues an error for shorter vectors.

Usage

1
checkRange1D(rng, varType, emptyOkay = FALSE)

Arguments

rng

Range. A numeric vector that ought to be an ordered pair.

varType

String describing the variable type. One of 'logical' or 'numeric'.

emptyOkay

Boolean. TRUE if a null or NA range is allowed, default to FALSE.

Details

If varType is 'logical', range is coerced to c(0,1).

If emptyOkay, no error will be raised if the input range is null or NA, and an NA value will be returned.

Value

Vector of length 2 or NULL


IQSS/PSI-Library documentation built on Feb. 15, 2020, 9:03 p.m.