# NOT RUN {
library(tibble)
library(sf)
library(FuzzyR)
set.seed(456)
# some random points to create pgeometry objects by using the function spa_creator
tbl = tibble(x = runif(10, min= 0, max = 30),
y = runif(10, min = 0, max = 30),
z = runif(10, min = 0, max = 50))
#getting the convex hull on the points to clipping the construction of plateau region objects
pts <- st_as_sf(tbl, coords = c(1, 2))
ch <- st_convex_hull(do.call(c, st_geometry(pts)))
pregions <- spa_creator(tbl, base_poly = ch, fuzz_policy = "fcp", k = 2)
# Showing the default list of classes
spa_overlap(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
# Changing the default classification
classes <- c("small", "medium", "large")
small <- genmf("trapmf", c(0, 0.3, 0.4, 0.6))
medium <- genmf("trapmf", c(0.4, 0.6, 0.8, 1))
large <- genmf("trapmf", c(0.6, 0.8, 1, 1))
spa_set_classification(classes, c(small, medium, large))
spa_overlap(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
# }
Run the code above in your browser using DataLab