powered by
Computes validated positive indices from given indices.
validateIndices(idxs = NULL, maxIdx, allowOutOfBound = TRUE)
A integer vector. If NULL, all indices are considered.
integer
vector
NULL
The possible max index.
Allow positive out of bound to indicate NA.
NA
Returns a validated integers list indicating the indices.
# NOT RUN { idxs <- validateIndices(c(-4, 0, -3, -1), 5) # [2, 5] idxs <- validateIndices(c(4, 4, 8, 2, 3), 8) # [4, 4, 8, 2, 3] # }
Run the code above in your browser using DataLab