Learn R Programming

k5 (version 0.2.1)

what_in: Which in

Description

Return the values of x that are %in% of the vector y.

Usage

what_in(x, y, ignore.case = FALSE)

Value

The elements of x that are %in% y.

Arguments

x

A vector to check.

y

A vector to compare against.

ignore.case

logical; if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

Details

x[which(x %in% y)]

See Also

Other counting wrappers: count_diff(), count_in(), count_na(), count_out(), na_in(), na_out(), na_rep(), prop_distinct(), prop_in(), prop_na(), prop_out(), what_out()

Examples

Run this code
what_in(c("VT", "DC", NA), state.abb)

Run the code above in your browser using DataLab