plot_kaya: Plot Kaya-identity variable

Description Usage Arguments Value Examples

View source: R/plot_kaya.R

Description

Plot Kaya-identity variable

Usage

1
2
3
plot_kaya(kaya_data, variable, start_year = NA, stop_year = NA,
  y_lab = NULL, log_scale = FALSE, trend_line = FALSE,
  points = TRUE, font_size = 20)

Arguments

kaya_data

A tibble with Kaya-identity data

variable

The name of the variable to plot (character)

start_year

The year to start highlighting the data (should correspond to the beginning of the trend calculation). Set to NULL to turn off highlighting.

stop_year

The year to stop highlighting the data (should correspond to the beginning of the trend calculation). Set to NULL to turn off highlighting.

y_lab

Optional label for the y-axis

log_scale

Use log scale for y axis

trend_line

Include a trend line

points

Plot points in addition to the line.

font_size

Base size of the font for axis labels and titles.

Value

A plot object.

Examples

1
2
3
4
5
6
china <- get_kaya_data("China")
plot_kaya(china, "F", 2001, 2011)
uk <- get_kaya_data("United Kingdom")
plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE)
world <- get_kaya_data("World")
plot_kaya(world, "g", 1982, log_scale = TRUE, trend_line = TRUE)

kayadata documentation built on May 1, 2019, 6:32 p.m.