plot_emissions: Plot of annual greenhouse gas emissions

Description Usage Arguments Details Examples

View source: R/plot_emissions.R

Description

plot_emissions draws a plot of annual greenhouse gas emissions for the countries provided to the regions argument.

Usage

1
plot_emissions(df, regions = NULL, title = NULL)

Arguments

df

A dataframe containing annual carbon dioxide, methane and nitrous oxide emissions records by country or region. It must include variables iso_code, year, co2, methane and nitrous_oxide, where iso_code is a code uniquely identifying each region. The greenhouse gases emissions units should be in million tonnes of carbon dioxide-equivalents. One such dataframe can obtained from Our World in Data: https://github.com/owid/co2-data.

regions

A character vector containing the codes of countries and/or regions that should be included in the plot. The codes must match those of the df variable iso_code.

title

The title of the plot. It is NULL by default.

Details

The x-axis range of the plot goes from the earliest to the latest year with available data for any of the regions provided to the regions argument.

If the number of regions requested is between two and ten, a legend is added to the plot.

If not provided or set to NULL, all of the regions in df are included in the plot.

Examples

1
2
3
4
5
Greenhouse_Gas_Emissions <-
read.csv("https://raw.githubusercontent.com/owid/co2-data/master/owid-co2-data.csv")
plot_emissions(Greenhouse_Gas_Emissions,
c("USA", "CHN", "GBR", "RUS"),
"Emissions of historical global powers")

omunizb/climate-change documentation built on Jan. 3, 2022, 12:15 a.m.