n_match: Count the Number of Matches for Each Element in a Vector

View source: R/n_match.R

n_matchR Documentation

Count the Number of Matches for Each Element in a Vector

Description

This function counts how many times each element of vector x matches any element in vector y.

Usage

n_match(x, y)

Arguments

x

A vector of elements to be matched.

y

A vector in which the elements from x will be matched.

Value

An integer vector of the same length as x, where each element indicates the number of times it matches in y.

Examples

## Not run: 
x <- c(1, 2, 3)
y <- c(1, 1, 2, 4)
n_match(x, y)
## End(Not run)


hgnc documentation built on June 18, 2025, 9:09 a.m.