norm2unif: Convert normal to uniform

Description Usage Arguments Value Examples

View source: R/distribution_convertors.R

Description

Convert a normal (gaussian) distribution to a uniform distribution with specified minimum and maximum

Usage

1
norm2unif(x, min = 0, max = 1, mu = mean(x), sd = stats::sd(x))

Arguments

x

the normally distributed vector

min

the minimum of the uniform distribution to return

max

the maximum of the uniform distribution to return

mu

the mean of x (calculated from x if not given)

sd

the SD of x (calculated from x if not given)

Value

a vector with a uniform distribution

Examples

1
2
3
4
x <- rnorm(10000)
y <- norm2unif(x)
g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y))
ggExtra::ggMarginal(g, type = "histogram")

faux documentation built on Sept. 14, 2021, 1:08 a.m.