Skip to contents

Stratify a raster Stack into the best fitting classes

Usage

Random_Stratified_Min_Dist(
  ClassRaster = NULL,
  MinDist = NULL,
  BorderDist = NULL,
  n = NULL,
  n_to_test = 100
)

Arguments

ClassRaster

a raster with the classes of your site as integers.

MinDist

Minimum distance of a random point to the sampling points and cells with other classes.

BorderDist

Minumum distance of a random point to the border of its class, if NULL if reverst to MinDist.

n

Number of points per class can be one number or a vector specifying de number per class.

n_to_test

Number of points to test for the minimum distance.

Value

An sf with the points and their classes

Examples

data(Bios)

library(terra)

Bios <- terra::unwrap(Bios)

a <- Stratify(Bios)


plot(a$FinalStack, colNA = "black")


FinalRaster <- a$FinalStack

Points <- Random_Stratified_Min_Dist(ClassRaster = FinalRaster,
                                     MinDist = 2000,
                                     n = 30,
                                     n_to_test = 100)
#> Joining with `by = join_by(x, y)`