Plots a histogram and density estimates using ggplot.
gghist(y, title = NULL, xlab = NULL, ylab = "counts", bins, add.normal = TRUE)
a numeric vector or an object of the ts
class containing a stationary time series.
a string with the plot's title.
a string with the plot's x axis label. By default a NUll value
a string with the plot's y axis label. By default a "counts" value
The number of bins to use for the histogram. Selected by default using the Friedman-Diaconis rule.
A boolean value. Add a normal density function for comparison,
by default add.normal = TRUE
.
None. Function produces a ggplot2 graph.
# NOT RUN {
x = rnorm(100)
gghist(x,add.normal = TRUE)
# }
Run the code above in your browser using DataLab