This function is similar to dplyr::na_if()
, but it has 2 differences. the
values of y
are never recycled. There are two ways to provide the condition.
As values or as a logical vector.
Arguments
- x
A vector.
- values
A vector of values. If the length of values = 1, it is actually the preferable to use
dplyr::na_if()
for clarity.- expr
A logical vector same length as x