Replance NaN with NA

replace_nan(x)

Arguments

x

Vector (can be used for a data frame column)

Value

Vector with NaNs replaced with NAs

Examples

replace_nan(c(0, 1, 2, NaN))
#> [1]  0  1  2 NA