subsetHelpers: Subset helper functions

subsetHelpersR Documentation

Subset helper functions

Description

Functions that return x[i] but with alternate behaviour when i is greater than the length of x.

Usage

loopSubset(x, i)

overflowSubset(x, i)

Arguments

x

a vector to be subsetted.

i

a vector of indexes

Details

loopSubset will cycle back through the elements of x when i is too big. overflowSubset will simply give the last element of x instead.

Value

A vector containing elements of x, chosen by the index i.

Examples

loopSubset(1:10,1:20)
overflowSubset(1:10,1:20)

R-graphic-design/RGD documentation built on Jan. 2, 2023, 10:30 p.m.