terra_jaccard: Jaccard similarity coefficient among two SpatRaster objects

View source: R/rfunctions.R

terra_jaccardR Documentation

Jaccard similarity coefficient among two SpatRaster objects

Description

Jaccard coefficient among two SpatRaster objects

Usage

terra_jaccard(x, y)

Arguments

x

SpatRaster object with binary values.

y

SpatRaster object with binary values.

Details

Jaccard similarity coefficient evaluates the percentage number equal to the intersection between two sets, divided by the size of the union of these sets.

Value

A numeric value [0,1].

Examples

set.seed(42)
x <- terra::rast(matrix(rbinom(100, 1, 0.2), nrow=10))
y <- terra::rast(matrix(rbinom(100, 1, 0.8), nrow=10))
terra_jaccard(x, y)

prior3D documentation built on April 11, 2025, 5:39 p.m.