powered by
Set a proportion or number of missing values
set_prop_miss(x, prop = 0.1)set_n_miss(x, n = 1)
set_n_miss(x, n = 1)
vector with missing values added
vector of values to set missing
proportion of values between 0 and 1 to set as missing
number of values to set missing
vec <- rnorm(5) set_prop_miss(vec, 0.2) set_prop_miss(vec, 0.4) set_n_miss(vec, 1) set_n_miss(vec, 4)
Run the code above in your browser using DataLab