Skip to contents

Takes a barrier mask (created with create_barrier_mask()) and fragments up the habitat where they intersect.

Usage

fragment_habitat(buffered_habitat, barrier_mask)

Arguments

buffered_habitat

Terra SpatRaster. Buffered habitat.

barrier_mask

Terra SpatRaster. Barrier mask.

Value

Terra SpatRaster with fragmented habitat.

Examples

lizard_habitat <- example_habitat()
lizard_barrier <- example_barrier()
buffered_habitat <- habitat_buffer(lizard_habitat, 5)
#> Warning: Buffer radius doesn't align with the raster resolution.
#>  5 m isn't a multiple of 2 m.
#>  It snaps to 4 m (interpatch distance 8 m).
#>  Connectivity may shift for patches near the cut-off.
#>  See `vignette(urbioconnect::interpatch-distance-and-resolution)`.
barrier_mask <- create_barrier_mask(lizard_barrier)
fragmented <- fragment_habitat(buffered_habitat, barrier_mask)