Learn R Programming

k5 (version 0.0.5)

na_out: Remove out

Description

Set NA for the values of x that are %out% of the vector y.

Usage

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

Value

The vector x missing any values not 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.

See Also

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

Examples

Run this code
na_out(c("VT", "NH", "ZZ", "ME"), state.abb)
na_out(1:10, seq(1, 10, 2))

Run the code above in your browser using DataLab