Given a data frame or matrix of numeric variables, this function returns a named list of
ggplot2
histogram (or bar) plots—one per column. For each variable it displays
a vertical line at the mean and an annotation of mean and standard deviation (or just mean).
Arguments
- df
A
data.frame
or matrix whose columns are the variables to plot.- tol
Numeric; tolerance for deciding whether a variable is integer-valued. Values within
tol
of an integer are plotted as counts (bars).- SD
Logical; if
TRUE
, annotate each plot with mean and standard deviation; ifFALSE
, annotate with mean only.