Skip to contents

Stratify a raster Stack into the best fitting classes

Usage

Stratify(Stack = NULL, LowGroup = 2, HighGroup = 10, Criterion = "calinski")

Arguments

Stack

a spatraster with all the variables used for generating the classes.

LowGroup

an integer number, the lowest number of groups to test for.

HighGroup

an integer number, the highest number of groups to test for.

Criterion

either calinski or ssi, the criterion used for selecting the best number of groups.

Value

a list with the raster for the best classes and a dataframe with the best results

Examples

data(Bios)
Bios <- terra::unwrap(Bios)
a <- Stratify(Bios)

library(terra)

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