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

MATCH

Value Matching


Description

MATCH is a generic function for value matching.

Usage

MATCH(x, table, nomatch = NA, ...)
## S3 method for class 'times'
MATCH(x, table, nomatch = NA, units = "sec", eps = 1e-10, ...)

Arguments

x

an object.

table

the values to be matched against.

nomatch

the value to be returned in the case when no match is found. Note that it is coerced to integer.

units

See trunc.times.

eps

See trunc.times.

...

further arguments to be passed to methods.

Details

MATCH is a new generic function which aims at providing the functionality of the non-generic base function match for arbitrary objects. Currently, there is only a default method which simply calls match.

MATCH.times is used for chron objects. x will match any time in table less than units away.

See Also

Examples

MATCH(1:5, 2:3)

zoo

S3 Infrastructure for Regular and Irregular Time Series (Z's Ordered Observations)

v1.8-10
GPL-2 | GPL-3
Authors
Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>), Gabor Grothendieck [aut], Jeffrey A. Ryan [aut], Joshua M. Ulrich [ctb], Felix Andrews [ctb]
Initial release
2022-04-15

We don't support your browser anymore

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