Learn R Programming

spectrolab (version 0.0.18)

i_is_index: 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)

Value

boolean

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

Author

Jose Eduardo Meireles

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.