na_if_any | R Documentation |
Convert values in x
to NA
if they match any elements of y
.
na_if_any(x, y)
x |
Vector to modify. |
y |
Values to replace with NA. |
A modified version of x
that replaces any values that are equal to any element of y with NA.
This is similar to dplyr::na_if()
but checks each element of x
for a match with
any elements of y
.
na_if_any(1:5, c(2, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.