create_bar
takes output from one of the *_table
functions and
produces a bar chart.
plot_bar( .table, .by = NULL, highlight = NULL, incl_missing = FALSE, title = NULL, x_lab = NULL, y_lab = NULL, legend = FALSE, legend_title = title, bottom_legend = TRUE, palette = c("blue", "red", "pink", "purple", "deep-purple", "indigo", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey"), background = "gray93" )
.table | The output of |
---|---|
.by | The variable to chart; defaults to the first column of
|
incl_missing | Should the chart include missing values as a category? |
title | The title of the chart; defaults to a title-case version of the variable name |
x_lab | Label for the x-axis; defaults to no label |
y_lab | Label for the y-axis; defaults to no label |
legend | Should a legend be displayed? Bar charts should usually not
require a legend, so the default is |
legend_title | The title of the chart legend; defaults to the chart title |
bottom_legend | Should the legend be positioned at the bottom or on the right side? Default is bottom. |
palette | The color palette to use; this is a material design color
palette generated by |
background | What should the background color be? Defaults to a light gray to lessen eye strain. |
A ggplot object