generateOutliers {outForest} | R Documentation |
Adds Outliers
Description
Takes a vector, matrix or data frame and replaces some numeric values by outliers.
Usage
generateOutliers(x, p = 0.05, sd_factor = 5, seed = NULL)
Arguments
x |
A vector, matrix or |
p |
Proportion of outliers to add to |
sd_factor |
Each outlier is generated by shifting the original value by a
realization of a normal random variable with |
seed |
An integer seed. |
Value
x
with outliers.
See Also
Examples
generateOutliers(1:10, seed = 334, p = 0.3)
generateOutliers(cbind(1:10, 10:1), p = 0.2)
head(generateOutliers(iris))
head(generateOutliers(iris, p = 0.2))
head(generateOutliers(iris, p = c(0, 0, 0.5, 0.5, 0.5)))
head(generateOutliers(iris, p = c(Sepal.Length = 0.2)))
[Package outForest version 1.0.1 Index]