Description Usage Arguments Value Examples
This function randomly introduce some amount of missing values into a matrix.
1 |
data |
a data matrix to simulate |
p |
the percentage of missing values introduced into the data matrix it should be a value between 0 and 1. |
the same size matrix with simulated missing values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Create data without missing values as example
simdata <- matrix(rnorm(100), 10, 10)
# Now let's introduce some missing values into the dataset
missingdata <- SimIm(simdata, p = 0.15)
# count the number of missing values afterwards
sum(is.na(missingdata))
#------------------
# There is no missing values in the original parkinson data
data(parkinson)
# Let's introduce some missing values into the dataset
missdata <- SimIm(parkinson, 0.1)
# count the number of missing values afterwards
sum(is.na(missdata))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.