View source: R/pre_processing.R
add_missingness | R Documentation |
Helper function to add missing values to data.
add_missingness(X, prop, cols = NULL)
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 |
Data with missing values
whole_data <- data.frame(a = rnorm(1000),
b = rnorm(1000))
missing_data <- add_missingness(whole_data, 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.