add_missingness {rMIDAS} | R Documentation |
Apply MAR missingness to data
Description
Helper function to add missing values to data.
Usage
add_missingness(X, prop, cols = NULL)
Arguments
X |
A data.frame or similar |
prop |
Numeric value between 0 and 1; the proportion of observations set to missing |
cols |
A vector of column names to be corrupted; if NULL, all columns are used |
Value
Data with missing values
Examples
whole_data <- data.frame(a = rnorm(1000),
b = rnorm(1000))
missing_data <- add_missingness(whole_data, 0.1)
[Package rMIDAS version 1.0.0 Index]