aux.rndmissing {filling} | R Documentation |
Randomly assign NAs to the data matrix with probability x
Description
aux.rndmissing
randomly selects 100\cdot x
% of entries from
a given data matrix and turns them into missing entries, i.e., their values
become NA
.
Usage
aux.rndmissing(A, x = 0.1)
Arguments
A |
an |
x |
percentage of turning current entries into missing ( |
Value
an (n\times p)
data matrix with missing entries at proportion x
.
Examples
# load lena64 image matrix
data(lena64)
# generate 10% of missing values
lena64_miss <- aux.rndmissing(lena64)
# visualize
par(mfrow=c(1,2))
image(lena64, axes=FALSE, main="original image")
image(lena64_miss, axes=FALSE, main="10% missing entries")
[Package filling version 0.2.3 Index]