legendPlot: Plot a raster with a custom legend below

Description Usage Arguments Value Author(s) Examples

View source: R/legendPlot.R

Description

Plots a raster with binned colors and adds a legend below the image.

Usage

1
2
3
4
5
6
7
8
9
legendPlot(
  x = NULL,
  thisVariable = names(x)[1],
  round_dec = 0,
  cols = NULL,
  bks = NULL,
  addpoints = FALSE,
  matchingQ = FALSE
)

Arguments

x

raster. A raster to be plotted.

thisVariable

character. The name of the variable in the raster. Defaults to the name of the raster.

round_dec

numeric. The number of decimal places to round the labels of the legend. Defaults to 0.

cols

vector of colors to use in the legend. Default colors range from yellow to dark brown through 8 distinct colors.

bks

vector of breaks to use in designating which values get assigned to each color in cols. Must have one more element than cols. Unless bks are designated, this vector will be calculated internally from cols.

addpoints

boolean. Indicates whether the locations of subset cells should be added to the map as points. Defaults to FALSE.

matchingQ

boolean. Indicates whether the map to be plotted is of matching quality. Defaults to FALSE.

Value

a plot of the raster with a legend.

Author(s)

Rachel R. Renne

Examples

1
2
3
4
5
# Load targetcells data for Target Cells
data(targetcells)

# Plot the raster with a legend
legendPlot(targetcells[[1]])

DrylandEcology/rMultivariateMatching documentation built on Dec. 17, 2021, 5:30 p.m.