A convenient wrapper around terra::plot
to generate formatted plots comparing two rasters.
This is used in the context of voluModel to
overlay semi-transparent distributions (coded as 1)
in two different RasterLayers.
A plot of class recordedplot overlaying mapped,
semitransparent extents of the input rasters
Arguments
rast1
A single SpatRaster showing the
distribution of the species corresponding to
rast1Name. Should have values of 0 (absence)
and 1 (presence). Can also be NULL.
rast2
A single SpatRaster showing the
distribution of the species corresponding to
rast2Name. Should have values of 0 (absence)
and 1 (presence). Must match the extent and
resolution of rast1. Can also be NULL.
col1
Color for rast1 presences
col2
Color for rast2 presences
rast1Name
An optional name for the first set
of occurrences, which will be color-coded to
occs1Col in the resulting plot.
rast2Name
An optional name for the first set
of occurrences, which will be color-coded to
occs2Col in the resulting plot.
land
An optional coastline polygon shapefile
of types sf or SpatRaster to provide geographic
context for the occurrence points.
landCol
Color for land on map.
title
A title for the plot.
graticule
Do you want a grid of lon/lat lines?
...
Additional optional arguments to pass to
terra::plot().