matchAll {tuple}R Documentation

Match All Values

Description

Extends the functionality of match to identify all matching values, instead of just the first one.

Usage

matchAll(x, table)

Arguments

x

A vector.

table

The lookup table as a vector.

Details

Returns an integer vector of the index in table for all the matches. The result is not sorted in numerical index order when more than one value is sought to be matched. Instead, the matches of the first value in x are listed first, followed by matches to the second value in x and so on. Values of NA are treated as data.

See Also

match

Examples

matchAll(3, c(1:3, 3, 4:6, 3, NA, 4))
matchAll(3:4, c(1:3, 3, 4:6, 3, NA, 4))
matchAll(c(NA, 3:4), c(NA, 1:3, 3, 4:6, 3, NA, 4))

[Package tuple version 0.4-02 Index]