powered by
Convert normal to poisson
norm2pois(x, lambda, mu = mean(x), sd = stats::sd(x))
a vector with a poisson distribution
the normally distributed vector
the mean of the distribution to return
the mean of x (calculated from x if not given)
the SD of x (calculated from x if not given)
x <- rnorm(10000) y <- norm2pois(x, 2) g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
Run the code above in your browser using DataLab