Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

SimIm

Introduce some missing values into a data matrix


Description

This function randomly introduce some amount of missing values into a matrix.

Usage

SimIm(data, p = 0.1)

Arguments

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.

Value

the same size matrix with simulated missing values.

Examples

# 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))

imputeR

A General Multivariate Imputation Framework

v2.2
GPL-3
Authors
Steffen Moritz [aut, cre] (<https://orcid.org/0000-0002-0085-1804>), Lingbing Feng [aut], Gen Nowak [ctb], Alan. H. Welsh [ctb], Terry. J. O'Neill [ctb]
Initial release
2020-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.