Learn R Programming

hgnc (version 0.3.0)

n_match: 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)

Value

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

Arguments

x

A vector of elements to be matched.

y

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

Examples

Run this code
if (FALSE) {
x <- c(1, 2, 3)
y <- c(1, 1, 2, 4)
n_match(x, y)}

Run the code above in your browser using DataLab