gen_data_mcar: Create MCAR missingness in a dataframe.

Description Usage Arguments Value Examples

Description

gen_data_mcar takes a dataframe and adds in missingness, returning the original, and newdata

Usage

1
gen_data_mcar(data, miss.perc, seed, col.num)

Arguments

data

= data you want to inflict the missingness on

miss.perc

= percent of missing data you want (approximately)

seed

= set the random seed for reproducibility.

col.num

= range of column numbers to set to random missingness. This could be improved.

Value

this function should return a dataframe

Examples

1
2
3
4
dat.mcar <- gen_data_mcar(data = iris,
                          miss.perc =  0.5,
                          seed = 1234,
                          col.num = c(1:3))

njtierney/mex documentation built on May 23, 2019, 8:22 p.m.