Learn R Programming

hockeystick (version 1.0.0)

plot_cmip6_anom: Download and plot essential climate data

Description

Plots expected climate change (projection minus 1970-2000 baseline) computed by get_cmip6_anom() with a diverging color scale centered on zero.

Usage

plot_cmip6_anom(
  dataset = get_cmip6_anom(),
  zero_centered = FALSE,
  xlim = NULL,
  ylim = NULL,
  country = NULL,
  state = NULL,
  mask = TRUE,
  print = TRUE
)

Value

Invisibly returns a ggplot2 object with the change map.

Arguments

dataset

Name of the tibble generated by get_cmip6_anom

zero_centered

(boolean) Use a symmetric diverging scale around zero, defaults to FALSE (scale runs from zero up).

xlim, ylim

(numeric) Optional two-element longitude/latitude bounds to zoom the map to a region, e.g. xlim = c(-130, -60), ylim = c(20, 70). The color scale is recomputed on the visible region.

country

(string) Optional country name or ISO 3166-1 alpha-3 code to zoom the map to that country. Requires the geodata package.

state

(string) Optional state/province name (admin-1), used together with country to zoom to a subnational region, e.g. country = "MEX", state = "Sonora". Requires the geodata package.

mask

(boolean) If country is given, blank cells outside the country border, defaults to TRUE.

print

(boolean) Display map, defaults to TRUE.

Author

Hernando Cortina, hch@alum.mit.edu

Details

plot_cmip6_anom returns a pre-defined ggplot2 world map of expected change in degrees C (or percent for precipitation variables), with blue for cooling/drying and red for warming/wetting. Precipitation maps with both increases and decreases automatically use the diverging scale even when zero_centered = FALSE. Users may further modify the output chart.

References

See get_cmip6.

Examples

Run this code
# \donttest{
plot_cmip6_anom()
# }

Run the code above in your browser using DataLab