which.customized: Which customized

Description Usage Arguments Value Examples

View source: R/which_customized.R

Description

Same function as base::which, except that it returns NA instead of integer(0) when there is not TRUE in x

Usage

1
which.customized(x, arr.ind = FALSE, useNames = TRUE)

Arguments

x

a logical vector or array. NAs are allowed and omitted (treated as if FALSE).

arr.ind

logical; should array indices be returned when x is an array?

useNames

logical indicating if the value of arrayInd() should have (non-null) dimnames at all.

Value

If TRUE present in x: same thing as base::which, else returns NA

Examples

1
2
which(letters == "a character that doesn't exist")
which.customized(letters == "a character that doesn't exist")

RemiMahmoud/helper.functions documentation built on April 21, 2021, 10:51 a.m.