View source: R/plotResistance.R
| plotResistance | R Documentation |
Draws a resistance SpatRaster using a shared colour scheme (green for low
resistance through red for high resistance) with a discrete-swatch legend placed to
the left of the panel. Each resistance value is mapped to a fixed colour so that the
same value appears identical across figures, which is useful when comparing several
landscapes or when pairing a resistance surface with a network plot (see
plotWithResistance()).
plotResistance(x, maxResistance = 12L)
x |
A resistance |
maxResistance |
Integer. The resistance value mapped to the top (red) end of
the colour ramp; values from |
A ggplot2::ggplot() object.
Alex M Chubaty
plotWithResistance(), ggGS()
tiny <- terra::rast(
system.file("extdata", "tiny.asc", package = "grainscape", mustWork = TRUE)
)
tinyCost <- terra::classify(tiny, rcl = cbind(c(1, 2, 3, 4), c(1, 5, 10, 12)))
plotResistance(tinyCost)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.