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

which

Which values in an object are considered TRUE?


Description

Give the indices of the values in a vector-, array-, or list-like object that are considered TRUE, allowing for array indices in the case of an array-like object.

NOTE: This man page is for the which S4 generic function defined in the BiocGenerics package. See ?base::which for the default method (defined in the base package). Bioconductor packages can define specific methods for objects (typically vector-, array-, or list-like) not supported by the default methods.

Usage

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

Arguments

x

An object, typically with a vector-, array-, or list-like semantic.

arr.ind, useNames

See ?base::which for a description of these arguments.

Value

See ?base::which for the value returned by the default method.

Specific methods defined in Bioconductor packages should behave as consistently as possible with the default method.

See Also

  • base::which for the default which method.

  • showMethods for displaying a summary of the methods defined for a given generic function.

  • selectMethod for getting the definition of a specific method.

  • which,DelayedArray-method in the DelayedArray package for an example of a specific which method (defined for DelayedArray objects).

  • BiocGenerics for a summary of all the generics defined in the BiocGenerics package.

Examples

which
showMethods("which")
selectMethod("which", "ANY")  # the default method

library(DelayedArray)
showMethods("which")
## The which() method for DelayedArray objects:
selectMethod("which", "DelayedArray")

BiocGenerics

S4 generic functions used in Bioconductor

v0.36.1
Artistic-2.0
Authors
The Bioconductor Dev Team
Initial release

We don't support your browser anymore

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