Description Usage Arguments Value
create_bar
takes output from one of the *_table
functions and
produces a bar chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.