Skip to contents

Simple interface to ggplot2 histogram

Usage

gghist(x, density = FALSE, ...)

Arguments

x

A vector of values to make a histogram out of

density

Should y-axis be density? (default: FALSE)

...

Further arguments to ggplot2::geom_histogram()

Examples

gghist(rnorm(100))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

gghist(runif(100), breaks=seq(0, 1, 0.1))

gghist(rnorm(100), density=TRUE)
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.