whittaker_base_plot: Create the Whittaker biome base figure

View source: R/base_figure.R

whittaker_base_plotR Documentation

Create the Whittaker biome base figure

Description

Creates the Whittaker biome figure from the vignette example. This can be modified by passing additional ggplot2 style arguments to it.

Usage

whittaker_base_plot(color_palette = NULL)

Arguments

color_palette

A named or unnamed vector of length 9 that contains either color names or values. If named, the names should correspond to biome names in the Whittaker_biomes data object. See details for additional information. The default is to use the colors from Figure 5.5 in Ricklefs, R. E. (2008), The economy of nature (Chapter 5, Biological Communities, The biome concept). If the vector is not named, the function will insert the names automatically

Details

To specify your own color palette, create a named vector where the names correspond to biome type and the values correspond to the colors you'd like to use. This can either be numeric (e.g. 1,2,3, etc) or character (e.g. 'red' or '#C1E1DD'). The names for each biome are as follows:

  • Tundra

  • Boreal forest

  • Temperate seasonal forest

  • Temperate rain forest

  • Tropical rain forest

  • Tropical seasonal forest/savanna

  • Subtropical desert

  • Temperate grassland/desert

  • Temperate grassland/desert

  • Woodland/shrubland

If the vector is unnamed, the names from Ricklefs (2008) will be inserted automatically.

Add additional features (e.g. theme() elements) using normal ggplot2 syntax. See examples.

Value

An object of class gg and ggplot.

Author(s)

Sam Levin, Valentin Stefan

Examples


library(ggplot2)
# Create the base plot

whittaker_base_plot()

# move the legend to top left corner, add border box,
# and adjust the background fill and grid.

whittaker_base_plot() +
  theme(legend.position = c(0.15, 0.75),
        panel.background = element_blank(),
        panel.grid.major = element_line(gray(0.7)),
        panel.border = element_rect(fill = NA))


valentinitnelav/plotbiomes documentation built on Oct. 22, 2022, 6:22 a.m.