R/studyAreaPlotting.R
plotSAs.RdPlot 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")
)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.
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.
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.
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.
The main title for the ggplot2 object. Defaults to one or both of "studyArea" and "rasterToMatch" or their plurals.
Used in rasterToMatch legend
A palette to be used for colour scheme in rasterToMatch plotting.
Can be any that work with tidyterra::whitebox.colors.
The country for jurisdiction boundaries; defaults to "CAN". Passed to
geodata::gadm
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.
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.
Run primarily for side effects. plotSAs plots (and returns) a ggplot2 object.
plotSAsLeaflet creates a leaflet page in a viewer (if using Rstudio).