powered by
Plots a histogram and density estimates using ggplot.
gghistogram( x, add.normal = FALSE, add.kde = FALSE, add.rug = TRUE, bins, boundary = 0 )
None.
a numerical vector.
Add a normal density function for comparison
Add a kernel density estimate for comparison
Add a rug plot on the horizontal axis
The number of bins to use for the histogram. Selected by default using the Friedman-Diaconis rule given by grDevices::nclass.FD()
grDevices::nclass.FD()
A boundary between two bins.
Rob J Hyndman
graphics::hist(), ggplot2::geom_histogram()
graphics::hist()
ggplot2::geom_histogram()
gghistogram(lynx, add.kde = TRUE)
Run the code above in your browser using DataLab