Plot all studyArea** and rasterToMatch** objects within a list-like object.

plotSAs(
  ll,
  ...,
  include = TRUE,
  exclude,
  saCols = c("purple", "blue", "green", "red"),
  title,
  rasterToMatchLabel = "Stand Age",
  rasterToMatchPalette = c("Set1", "Set2", "Set3"),
  country = "CAN",
  latlong = FALSE,
  minArea = 7e+11
)

plotSAsLeaflet(
  ll,
  ...,
  include = TRUE,
  exclude,
  saCols = c("purple", "blue", "green", "red"),
  title = "Study Areas",
  rasterToMatchLabel = "Stand Age",
  rasterToMatchPalette = c("Set1", "Set2", "Set3")
)

Arguments

ll

Any list-like object with named elements. Names must include at least one that starts with studyArea or rasterToMatch. Thus any of the permutations like studyAreaLarge or rasterToMatchPSP all are fine.

...

Any objects to plot. Currently, they must be named arguments, and they must have prefixes studyArea or rasterToMatch to be visualized.

include

Either logical or a character vector. If logical, this indicates whether all maps in the ll object should be plotted (if TRUE) or, if FALSE, no extra maps (on top of the defaults listed in ll argument description. If a character vector, then the objects indicated will also be plotted. Default is FALSE to prevent inadvertent (slow) plotting of potentially many layers.

exclude

A character vector of spatial objects contained within ll to exclude from plotting. This is run after include, so it will override any named objects specified in include.

saCols

A vector of same length as number of studyArea** objects, that defines the studyArea polygon boundary colours. These will be used in sequence from largest to smallest in polygon area.

title

The main title for the ggplot2 object. Defaults to one or both of "studyArea" and "rasterToMatch" or their plurals.

rasterToMatchLabel

Used in rasterToMatch legend

rasterToMatchPalette

A palette to be used for colour scheme in rasterToMatch plotting. Can be any that work with tidyterra::whitebox.colors.

country

The country for jurisdiction boundaries; defaults to "CAN". Passed to geodata::gadm

latlong

Logical. Should all layers be converted to latlong for plotSAs prior to plotting. This means that "North will be up"; this could be slow for large rasters. This happens by default with plotSAsLeaflet and can't be turned off.

minArea

In m^2. This is the minimium area for the entire plot. If this is too small then the legislative boundaries may not appear. The area covered by the plot will the maximum of the studyArea** or rasterToMatch** and this minArea value.

Value

Run primarily for side effects. plotSAs plots (and returns) a ggplot2 object. plotSAsLeaflet creates a leaflet page in a viewer (if using Rstudio).