replace_na: Replace Values in a Vector by NA
Description
![[Stable]](figures/lifecycle-stable.svg?package=random.cdisc.data&version=0.3.16)
Randomized replacement of values by NA
.
Usage
replace_na(v, percentage = 0.05, seed = NULL)
Value
The input vector v
where a certain number of values are replaced by NA
.
Arguments
- v
(any
)
Vector of any type.
- percentage
(proportion
)
Value between 0 and 1 defining
how much of the vector shall be replaced by NA
. This number
is randomized by +/- 5% to have full randomization.
- seed
(numeric
)
Seed to use for reproducible random number generation.