Convert values to NA.

na_if(x, y)

Arguments

x

A vector

y

Value to replace with NA

Examples

vec <- 1:3
na_if(vec, 3)
#> [1]  1  2 NA