plot_boundary {BoundaryStats}R Documentation

Map the boundary elements of two raster layers

Description

This is a wrapper function for ggplot2 that will produce a map of boundary elements for two traits and show where boundary elements intersect.

Usage

plot_boundary(x, y, color = NA, trait_names = NA)

Arguments

x

A SpatRaster object with boundary elements.

y

A SpatRaster object with boundary elements.

color

Optional. A character vector of up to three colors (x boundary, y boundary, and overlapping elements).

trait_names

Optional. A character vector with up to two elements (legend name for x and legend name for y).

Value

A ggplot2 object.

Author(s)

Amy Luo

Examples

data(T.cristatus)
T.cristatus <- terra::rast(T.cristatus_matrix, crs = T.cristatus_crs)
terra::ext(T.cristatus) <- T.cristatus_ext

data(grassland)
grassland <- terra::rast(grassland_matrix, crs = grassland_crs)
terra::ext(grassland) <- grassland_ext

Tcrist_boundaries <- categorical_boundary(T.cristatus)
grassland_boundaries <- define_boundary(grassland, 0.1)

plot_boundary(Tcrist_boundaries, grassland_boundaries)


[Package BoundaryStats version 2.1.1 Index]