createNA | R Documentation |
Create missing value for a dataset
createNA(data, names = NULL, p = 0.3, seed = NULL)
data |
a dataframe |
p |
the proportion of missing values in the dataframe |
seed |
random seed, a singlue value |
#create 30% MCAR data across all variables in a dataset
withNA.df<-createNA(iris,p=0.3)
#create 30% MCAR data in a specified variable in a dataset
withNA.df=createNA(iris,names=c("Sepal.Length"),p=0.3)
#create MCAR data in several specified variables in a dataset
withNA.df=createNA(iris,names=c("Sepal.Length","Petal.Width","Species"),p=c(0.3,0.2,0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.