Learn R Programming

hockeystick (version 0.8.5)

emissions_map: Download and plot essential climate data

Description

Plots a treemap of cumulative co2 emissions by country since 1900.

Usage

emissions_map(
  dataset = get_emissions(),
  print = TRUE,
  since = 1900,
  number = "all",
  title = substitute(paste(since, "-", to, " Cumulative " * CO[2] *
    " Emissions by Country"), list(since = since, to =
    as.character(dataset[nrow(dataset), 2])))
)

Value

Invisibly returns a ggplot2 object with emissions treemap

Arguments

dataset

Name of the tibble generated by get_emissions

print

(boolean) Display emissions treemap, defaults to TRUE. Use FALSE to not display chart.

since

(numeric) Start year for cumulative emissions, defaults to 1900 if omitted

number

(numeric) Number of countries to display in treemap, defaults to all if omitted

title

(string) Manually specify chart title

Author

Hernando Cortina, hch@alum.mit.edu

Details

emissions_map invisibly returns a ggplot2 object with cumulative emissions treemap by country since 1900 from get_emissions. By default the chart is also displayed. Users may further modify the output ggplot2 chart.

Examples

Run this code
# \donttest{
# Draw treemap

co2map <- emissions_map()

co2map <- emissions_map(since=2000, number=20, title="Top 20 Cumulative Emitters Since 2000") # }

Run the code above in your browser using DataLab