Skip to contents

Individual Boxplot Plots per Country

Usage

sahel_ggboxplot(
  data,
  variable,
  countries,
  title = deparse(substitute(variable)),
  subtitle = "Boxplot Plot",
  caption = NULL,
  xtitle = NULL,
  ytitle = NULL,
  scale = NULL,
  theme = themeaspdark
)

Arguments

data

A data frame

variable

Variable name to plot. Continuous or count.

countries

Variable name to plot. Continuous or count.

title

Plot title

subtitle

Plot subtitle

caption

Plot caption

xtitle

Plot x-axis title

ytitle

Plot y-axis title

scale

Scaling function from {ggplot2}

theme

Theme applied

Value

A ggplot object of boxplot style.

Examples

library(patchwork)
sahel_ggboxplot(
  data = sahel_sim,
  variable = hh_income,
  countries = country_names,
  title = "Household Income",
  scale = ggplot2::scale_x_log10
) + sahel_ggboxplot(
  data = sahel_sim,
  variable = hh_consumption,
  countries = country_names,
  title = "Household Consumption",
  scale = ggplot2::scale_x_log10
)