normality2color estimates the normality of vector x and returns a color code representing the result of a normality test.

normality2color(x, cols = c("green", "red", "gray"))

Arguments

x

a numeric vector

cols

a vector of three colors, the first used to represent normality, the second non-normality, and the third undetermined normality.

See also

Examples

normality2color(rnorm(30))
#> [1] "green"
normality2color(rnorm(3))
#> [1] "gray"
normality2color(runif(30))
#> [1] "red"