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

Match

Match


Description

Return the positions of its first argument that matches in its second.

Usage

Match(x,key=NULL)

Arguments

x

A numeric vector.

key

The value/vector for searching in vector x. For now let it NULL. dont't use it!.

Details

This function implements the R's \"match\" function. This version basicaly calculates the match(x,sort(unique(x))) for now. Do not use the argument key!

Value

Returns the position/positions of the given key/keys in the x vector.

Author(s)

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>

See Also

Examples

y <- rnorm(100)
a <- Match(y)
b <-50
all.equal(as.vector(a),as.vector(b))

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

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