random_missingness: Random generation of missingness in a data frame.

Description Usage Arguments Value

View source: R/random_missingness.R

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

1
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).


metagear documentation built on Feb. 15, 2021, 5:09 p.m.