jaccard {bamm}R Documentation

jaccard: Estimates the Jaccard index for comparing two binary maps

Description

Estimates the Jaccard index for comparing two binary maps

Usage

jaccard(m1, m2)

Arguments

m1

A binary raster A or an object of class setA returned by the function model2sparse.

m2

A binary raster A or an object of class setA returned by the function model2sparse.

Details

The Jaccard index is computed as follows

J(A,B)={{|A\cap B|}\over{|A\cup B|}}={{|A\cap B|}\over{|A|+|B|-|A\cap B|}}.

Value

Returns a data.frame with three values: 1) jaccard (Jaccard index), 2) percentage_m1 (the percentage of m1 that the intersection |A \cap B| represents), and 3) percentage_m2

Author(s)

Luis Osorio-Olvera & Jorge SoberĂ³n

Examples

m1_path <- system.file("extdata/conejos/Lepus_othus_cont.tif",
                       package = "bamm")
m2_path <- system.file("extdata/conejos/Brachylagus_idahoensis_cont.tif",
                       package = "bamm")
m1 <- raster::raster(m1_path) > 0.01
m2 <- raster::raster(m2_path) >0.01
jcc <- bamm::jaccard(m1,m2)
print(jcc)

[Package bamm version 0.4.3 Index]