Skip to contents

Creates a small bar chart.

Usage

fig_barplot(data, x, col_fill, x_lab = "Adverse events", y_lab = "Individuals")

Arguments

data

Data set to be used.

x

Variable to plot.

col_fill

Column with logical values, that defines the fill color.

x_lab

Character string with the text on the x-axis.

y_lab

Character string with the text on the y-axis.

Value

A ggplot2 object.

Examples

 df <- mtcars |>
 dplyr::mutate(
  fill_color = sample(c(TRUE, FALSE), 1),
  .by = cyl
  )
fig_barplot(df, cyl, fill_color)