Subscript generators

Share:

Description

These functions all return a vector of subscripts into their input.

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

Usage

1
2
3
which(x, arr.ind = FALSE, useNames = TRUE, ...)
which.max(x, ...)
which.min(x, ...)

Arguments

x

Vector-like object, logical for which, numeric for the others.

arr.ind, useNames

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

...

Additional arguments, for use in specific methods.

Value

See ?base::which and ?base::which.min for the value returned by the default methods.

Specific methods defined in Bioconductor packages will typically return an object of the same class as the input objects.

Note

The default methods (defined in the base package) only take a fixed set of arguments. We've added the ... argument to the generic functions defined in the BiocGenerics package so they can be called with an arbitrary number of effective arguments. This typically allows methods to add extra arguments for controlling/altering the behavior of the operation. Like for example the global argument supported by the which.max method for NumericList objects (defined in the IRanges package).

See Also

  • base::which for the default which, base::which.min for the others.

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

  • selectMethod for getting the definition of a specific method.

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

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
which
showMethods("which")
selectMethod("which", c("ANY", "ANY"))  # the default method

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

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.