pctin: Percentage of matching elements between two vectors

pctinR Documentation

Percentage of matching elements between two vectors

Description

Find the percentage of elements in x that are present in y.

Usage

x %pctin% y

Arguments

x

(Vector) The values to be matched.

y

(Vector) The values to be matched against.

Value

The percentage of elements in x that are present in y.

Authors

Source

https://stackoverflow.com/a/13830068/5578429

Examples

c(1, 4, 21, 7, -3) %in% 0:10
#> [1]  TRUE  TRUE FALSE  TRUE FALSE

c(1, 4, 21, 7, -3) %pctin% 0:10
#> [1] 0.6


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.