random_missingness {metagear}R Documentation

Random generation of missingness in a data frame.

Description

Generates random NA's in in a column or groups of columns of a data frame. Used in imputation simulations based on complete datasets.

Usage

random_missingness(aDataFrame, columnNames, percentMissing = 10)

Arguments

aDataFrame

A data.frame where missingness will be simulated.

columnNames

A string or a vector of strings that describe the column names (labels) where missingness will be simulated.

percentMissing

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.

Value

A data table with columns of missing data (specified as NA's).


[Package metagear version 0.7 Index]