Skip to contents

Add NA for a given value

Usage

treat_na(x, value)

Arguments

x

vector

value

value that shall be replaced by NA

Value

vector

Author

Victor Champonnois et Frédéric Grelot

Examples

x = sample(c("red", "blue"), 10, replace = TRUE)
floodam.data:::treat_na(x, "red")
#>  [1] NA     NA     NA     NA     NA     NA     "blue" NA     NA     NA    
floodam.data:::treat_na(x, "blue")
#>  [1] "red" "red" "red" "red" "red" "red" NA    "red" "red" "red"
floodam.data:::treat_na(x, "green")
#>  [1] "red"  "red"  "red"  "red"  "red"  "red"  "blue" "red"  "red"  "red"