powered by
Convert normal to binomial
norm2binom(x, size = 1, prob = 0.5, mu = mean(x), sd = stats::sd(x))
a vector with a binomial distribution
the normally distributed vector
number of trials (0 or more)
the probability of success on each trial (0 to 1)
the mean of x (calculated from x if not given)
the SD of x (calculated from x if not given)
x <- rnorm(10000) y <- norm2binom(x) g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
Run the code above in your browser using DataLab