gen_outlier {baizer} | R Documentation |
generate outliers from a series of number
Description
generate outliers from a series of number
Usage
gen_outlier(
x,
n,
digits = 0,
side = "both",
lim = NULL,
assign_n = NULL,
only_out = TRUE
)
Arguments
x |
number vector |
n |
number of outliers to generate |
digits |
the digits of outliers |
side |
should be one of |
lim |
a two-length vector to assign the limitations of the outliers
if method is |
assign_n |
manually assign the number of low outliers or
high outliers when method is |
only_out |
only return outliers |
Value
number vector of outliers
Examples
x <- seq(0, 100, 1)
gen_outlier(x, 10)
# generation limits
gen_outlier(x, 10, lim = c(-80, 160))
# assign the low and high outliers
gen_outlier(x, 10, lim = c(-80, 160), assign_n = c(0.1, 0.9))
# just generate low outliers
gen_outlier(x, 10, side = "low")
# return with raw vector
gen_outlier(x, 10, only_out = FALSE)
[Package baizer version 0.8.0 Index]