warming_stripes {hockeystick}R Documentation

Download and plot essential climate data

Description

Plots global "warming stripes" graph in the style popularized by Ed Hawkins, based on temperature anomaly retrieved using get_temp(). Function can output stripes chart with legend or a minimal chart. The output ggplot2 object may be further modified.

Usage

warming_stripes(
  dataset = get_temp(),
  stripe_only = FALSE,
  col_strip = RColorBrewer::brewer.pal(11, "RdBu"),
  print = TRUE
)

Arguments

dataset

Name of the tibble generated by get_temp

stripe_only

Display legend and axes, defaults to TRUE

col_strip

Color palette to use. Defaults to Red-Blue RColorBrewer palette.

print

(boolean) Display warming stripe ggplot2 chart, defaults to TRUE. Use FALSE to not display chart.

Details

warming_stripes invisibly returns a ggplot2 object with warming stripes chart using data from get_temp. By default the chart is also displayed. User may modify color palette or remove axes and legend. Users may further modify the output ggplot2 chart.

Value

Invisibly returns a ggplot2 object with warming stripes

Author(s)

Hernando Cortina, hch@alum.mit.edu

References

Examples


# Draw with axes and legend
stripes <- warming_stripes()

# Draw stripes only
stripes <- warming_stripes(stripe_only = TRUE)

# Don't display, store for further modifications
stripes <- warming_stripes(print = FALSE)

# Change color palette
stripes <- warming_stripes(stripe_only = TRUE, col_strip = viridisLite::viridis(11)) 


[Package hockeystick version 0.8.4 Index]