Skip to contents

Species suitability change between climate scenarios

Usage

suit.change(r1, r2, filename = "")

Arguments

r1

A SpatRaster with presence-absence data (0 or 1) for a set of species.

r2

A SpatRaster with presence-absence data (0 or 1) for a set of species.

filename

Character. Save results if a name is provided.

Value

A SpatRaster with suitability change (gain, loss, unchanged, and unsuitable).

Examples

# \donttest{
library(terra)
r1 <- terra::rast(system.file("extdata", "ref.tif",
package = "divraster"))
r2 <- terra::rast(system.file("extdata", "fut.tif",
package = "divraster"))
suit.change(r1, r2)
#> class       : SpatRaster 
#> dimensions  : 8, 8, 10  (nrow, ncol, nlyr)
#> resolution  : 0.125, 0.125  (x, y)
#> extent      : 0, 1, 0, 1  (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84 (EPSG:4326) 
#> source(s)   : memory
#> varname     : fut 
#> names       : A, B, C, D, E, F, ... 
#> min values  : 1, 1, 1, 1, 1, 1, ... 
#> max values  : 4, 4, 4, 4, 4, 4, ... 
# }