Randomized replacement of values by NA

replace_na(v, percentage = 0.05, seed = NULL)

Arguments

v

(any) vector of any type

percentage

(numeric) Value between 0 and 1 defining how much of the vector shall be replaced by NA. This number is randomized by plus minus 5 percent to have full randomization.

seed

(numeric) seed to set to make randomization reproducible

Value

The input vector v where a certain number of values is replaced by NA