segmetric_functions {segmetric} | R Documentation |
These functions manipulate segmetric
objects.
sm_read()
: Load the reference and segmentation polygons into segmetric.
sm_clear()
: Remove the already calculated metrics from segmetric.
print()
: Print a segmetric object.
plot()
: Plot the reference and segmentation polygons.
summary()
: Compute a measure of central tendency over the values of a metric.
sm_is_empty()
: Check if a segmetric
object is empty.
.segmetric_check(m)
.segmetric_env(m)
sm_read(ref_sf, seg_sf)
sm_clear(m)
## S3 method for class 'segmetric'
summary(object, weight = NULL, na_rm = TRUE, ...)
sm_is_empty(m)
## S3 method for class 'segmetric'
x[i]
m |
A |
ref_sf |
A |
seg_sf |
A |
object |
A |
weight |
Weights to summarize metrics. Accepts |
na_rm |
Should missing values (including |
... |
Additional parameters (Not implemented). |
sm_read()
, sm_clear()
: Return a segmetric
object containing an
empty list and an environment attribute to store the necessary datasets.
sm_is_empty()
: Return a logical
vector indicating if each computed
metric is empty.
sm_compute()
# 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)