miss_add_random | R Documentation |
Inserts missing data into a data.frame at random, thus creating data that are Missing Completely At Random (MCAR). THis isn't how data usually are missing in the real world, but may be sufficient for some situations.
miss_add_random(df, prop = 0.1)
df |
(data.frame) A data.frame. |
prop |
(num vector) The proportion of NAs to add. |
A data.frame.
df = data.frame(c(1:10), letters[1:10]) #example data
miss_add_random(df) #add 10% random NAs
miss_amount(df) #verify that 10% really is missing
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.