sim_missing | R Documentation |
Takes a data frame and randomly replaces a user-supplied proportion of values with 'NA'.
sim_missing(.data, prop, seed = NA)
.data |
A dataframe. |
prop |
Proportion of values to be set to 'NA'. |
seed |
An optional seed for random number generation. If 'NA' (default) a random seed will be used. |
a dataframe with NAs
library(dplyr)
df <- sim_cat(n_obs = 10, n_groups = 2) %>%
sim_covar(n_vars = 10, var = 1, cov = 0.5) %>%
sim_missing(0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.