match {BiocGenerics}R Documentation

Value matching

Description

match returns a vector of the positions of (first) matches of its first argument in its second.

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

Usage

match(x, table, nomatch=NA_integer_, incomparables=NULL, ...)

Arguments

x, table

Vector-like R objects (typically of the same class, but not necessarily).

nomatch, incomparables

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

...

Additional arguments, for use in specific methods.

Value

The same as the default method, that is, an integer vector of the same length as x giving the position in table of the first match if there is a match, otherwise nomatch.

See ?base::match for more details.

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

Note

The default method (defined in the base package) doesn't have the ... argument. We've added it to the generic function defined in the BiocGenerics package in order to allow specific methods to support additional arguments if needed.

See Also

base::match for the default match method.

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

selectMethod for getting the definition of a specific method.

match,Hits,Hits-method in the IRanges package for an example of a specific match method (defined for Hits objects).

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

Examples

match  # note the dispatch on the 'x' and 'table' args only
showMethods("match")
selectMethod("match", c("ANY", "ANY"))  # the default method

[Package BiocGenerics version 0.6.0 Index]