This function allows you to calculate the distance to the nearest neighbouring patch of the same class in meters The distance is measured from edge-to-edge.
Value
the function returns tibble with the calculated values in column "value", this function returns also some important information such as level, class, patch id and metric name.
Examples
vm_p_enn(vector_patches, "class", "patch")
#> # A tibble: 40 × 5
#> level class id metric value
#> <chr> <chr> <chr> <chr> <dbl>
#> 1 patch 1 11 enn 4
#> 2 patch 1 12 enn 1
#> 3 patch 1 13 enn 0
#> 4 patch 1 14 enn 0
#> 5 patch 1 15 enn 0
#> 6 patch 1 16 enn 0
#> 7 patch 1 17 enn 3.16
#> 8 patch 1 18 enn 2
#> 9 patch 1 19 enn 0
#> 10 patch 1 20 enn 0
#> # ℹ 30 more rows