dot-get_actual_index: Standardize Indices

.get_actual_indexR Documentation

Standardize Indices

Description

Convert negative indices to positive ones. Use the convention that vec[[-1L]] signifies the last element of vec, vec[[-2L]] signifies the second-to-last element of vec, and so on. 1-based indexing is assumed. Values of zero, or out-of-range indices, will be rejected.

Usage

.get_actual_index(index, length)

Arguments

index

Integer; the index to normalize.

length

Integer; the length of the vector or list we are indexing.

Value

The "actual" integer index, between 1 and length, inclusive.


jonathanbratt/RBERT documentation built on Jan. 26, 2023, 4:15 p.m.