Will additionally set all NaN elements to NA.

to_na(x, ...)

Arguments

x

A vector with elements that should set to NA

...

The elements that should be set to NA

Value

Vector with specified elements set to NA

Examples

to_na(c(1, NaN, 2, 3), 2, NaN)
#> [1] 1 NA NA 3