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"
)

Arguments

.table

The output of create_table which is a one-way tabyl encoded to assist visualization

.by

The variable to chart; defaults to the first column of .table, which will always be correct if the output is from a *_table function

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 FALSE

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 pal_material; see that function for details and available choices

background

What should the background color be? Defaults to a light gray to lessen eye strain.

Value

A ggplot object