Skip to contents

Usage

na_if_value(.x, .value)

value_if_na(.x, .value)

Arguments

.x

A vector.

.value

A value to convert to NA.

Details

Convert NAs easily.

Examples

x <- c(1, 2, NA, 4)
na_if_value(x, 2)
#> [1]  1 NA NA  4

value_if_na(x, 3)
#> [1] 1 2 3 4