Skip to contents

Individual Ridgeline Plots per Country

Usage

sahel_ggridges(
  data,
  variable,
  countries,
  title = deparse(substitute(variable)),
  subtitle = "Ridgeline 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 ridgeline style.

Examples

library(patchwork)
sahel_ggridges(
  data = sahel_sim,
  variable = hh_income,
  countries = country_names,
  title = "Household Income",
  scale = ggplot2::scale_x_log10
) + sahel_ggridges(
  data = sahel_sim,
  variable = hh_consumption,
  countries = country_names,
  title = "Household Consumption",
  scale = ggplot2::scale_x_log10
)
#> Picking joint bandwidth of 0.13
#> Picking joint bandwidth of 0.0685