Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

validateIndices

Validate indices


Description

Computes validated positive indices from given indices.

Usage

validateIndices(idxs = NULL, maxIdx, allowOutOfBound = TRUE)

Arguments

idxs

A integer vector. If NULL, all indices are considered.

maxIdx

The possible max index.

allowOutOfBound

Allow positive out of bound to indicate NA.

Value

Returns a validated integers list indicating the indices.

Examples

idxs <- validateIndices(c(-4, 0, -3, -1), 5)  # [2, 5]

idxs <- validateIndices(c(4, 4, 8, 2, 3), 8)  # [4, 4, 8, 2, 3]

matrixStats

Functions that Apply to Rows and Columns of Matrices (and to Vectors)

v0.58.0
Artistic-2.0
Authors
Henrik Bengtsson [aut, cre, cph], Constantin Ahlmann-Eltze [ctb], Hector Corrada Bravo [ctb], Robert Gentleman [ctb], Jan Gleixner [ctb], Peter Hickey [ctb], Ola Hossjer [ctb], Harris Jaffee [ctb], Dongcan Jiang [ctb], Peter Langfelder [ctb], Brian Montgomery [ctb], Hugh Parsonage [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.