gghist | R Documentation |
Plots a histogram and density estimates using ggplot.
gghist(y, title = NULL, xlab = NULL, ylab = "counts", bins, add.normal = TRUE)
y |
a numeric vector or an object of the |
title |
a string with the plot's title. |
xlab |
a string with the plot's x axis label. By default a NULL value. |
ylab |
a string with the plot's y axis label. By default a "counts" value. |
bins |
the number of bins to use for the histogram. Selected by default using the Friedman-Diaconis rule. |
add.normal |
a boolean value. Add a normal density function for comparison,
by default |
None.
Rob J Hyndman
x = rnorm(100)
gghist(x,add.normal = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.