Generates random NA
's in in a column or groups of columns of a data frame.
Used in imputation simulations based on complete datasets.
random_missingness(aDataFrame, columnNames, percentMissing = 10)
A data.frame where missingness will be simulated.
A string or a vector of strings that describe the column names (labels) where missingness will be simulated.
The percentage of missingness within specified columns.
"Percent missing" uses a binomial distribution to simulate missing data.
Default is 10 (i.e. 10% missing). Use impute_missingness
for
a summary of these randomly generated missing data.
A data table with columns of missing data (specified as NA
's).