AddOutlier {rsvddpd} | R Documentation |
Add outlier to matrix
Description
AddOutlier
returns a matrix with outliers randomly added to a matrix
given certain proportion of contamination
Usage
AddOutlier(X, proportion, value, seed = NULL, method = "element")
Arguments
X |
|
proportion |
|
value |
|
seed |
|
method |
|
Value
A matrix
with elements / rows / columns contaminated.
Note
Due to randomization, it is possible that the none of the entries of the matrix become contaminated. In that case, it is recommended to use different seed value.
Examples
X = matrix(1:20, nrow = 4, ncol = 5)
AddOutlier(X, 0.5, 10, seed = 1234)