Plot a bar plot using ggplot2.
horisontal_bar_plot(
df,
x_var,
fill_var,
title = NULL,
subtitle = NULL,
y_lab = NULL,
x_lab = NULL,
fill_colors = NULL,
percent_accuracy = 1,
...
)
Data frame.
Variable for x axis, use string name.
Recommended that x_var
is in character in df.
Variable for the different colors in bars,
use string name.
Use NULL
if only one color for bars.
Plot title, NULL
if no title.
Small text under title, NULL
if no subtitle.
Y-axis label, use NULL
for no label.
X-axis label, use NULL
for no label.
Color of the different categories in fill_var
.
Set accuracy for scales::percent_format()
.
arguments passed to theme_slr()
ggplot object containing bar plot.