i_is_index: Compatible with being an index?

View source: R/internal_utils.R

i_is_indexR Documentation

Compatible with being an index?

Description

i_is_index Tests if x fit the requirements of being indices

Usage

i_is_index(x, max_value, allow_negative = FALSE)

Arguments

x

numeric values

allow_negative

boolean. Count negative integers as indices? defaults to FALSE

max_length

Max acceptable values for x (inclusive). Must be >= 1

Details

This function potentially allows negative indices, given that they may be used with the intent of removing an entry that corresponds to the index. Conversely, zero is never used as an index in R and is not recognized as such here.

Value

boolean

Author(s)

Jose Eduardo Meireles


spectrolab documentation built on Feb. 16, 2023, 10:27 p.m.