plot_histogram.Rd
Wrapper around [ggplot2::geom_histogram()] that plots pretty histogram plots using a custom ggplot theme.
plot_histogram(
data,
x_str = NULL,
fill_str = NULL,
fill = "#6FBBE3",
bins = 12,
theme_options = NULL,
show_plot = FALSE,
...
)
Data frame to use for plot.
Character string. Name of variable in data
to plot on
x-axis. If NULL
, plot density using all values in data frame.
Character string (optional). Name of variable in data
to use as fill aesthetic in plot.
Fill color. Used only if fill_str
is NULL
.
Number of histogram bins.
(Optional) list of arguments to pass to vthemes::theme_vmodern().
Logical. Should this plot be printed? Default FALSE
.
Other arguments to pass to [ggplot2::geom_histogram()].
A ggplot histogram.
Other pretty_ggplot_wrappers:
plot_bar()
,
plot_boxplot()
,
plot_density()
,
plot_line()
,
plot_point()
## plot distribution of all data in data frame
plot_histogram(as.data.frame(rnorm(1000), nrow = 100))
## plot distribution of a single column in data frame
plot_histogram(iris, x_str = "Sepal.Width")
plot_histogram(iris, x_str = "Sepal.Width", fill_str = "Species")