# load sample datasets
data("sample_ref_sf", package = "segmetric")
data("sample_seg_sf", package = "segmetric")
# create segmetric object
m <- sm_read(ref_sf = sample_ref_sf, seg_sf = sample_seg_sf)
# plot geometries
plot(m)
# compute a metric
sm_compute(m, "AFI")
# summarize the metric using mean
sm_compute(m, "AFI") %>% summary()
# clear computed subsets
sm_clear(m)
Run the code above in your browser using DataLab