Description Usage Arguments Value See Also Examples
View source: R/generateOutliers.R
Takes a vector, matrix or data frame and replaces some numeric values by outliers.
1 | generateOutliers(x, p = 0.05, sd_factor = 5, seed = NULL)
|
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. |
x
with outliers.
1 2 3 4 5 6 | 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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.