Skip to contents

A generic function of which that is 'FileArray' compatible

Usage

fwhich(x, val, arr.ind = FALSE, ...)

# S3 method for default
fwhich(x, val, arr.ind = FALSE, ...)

# S3 method for FileArray
fwhich(x, val, arr.ind = FALSE, ...)

Arguments

x

any R vector, matrix, array or file-array

val

values to find

arr.ind

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

...

further passed to which or arrayInd

Value

The indices of x elements that are listed in val.

Examples



# Default case
x <- array(1:27, rep(3,3))
fwhich(x, c(4,5))
#> [1] 4 5

# file-array case
arr <- filearray_create(tempfile(), dim(x))
arr[] <- x
fwhich(arr, c(4,5))
#> [1] 4 5