Learn R Programming

fsr (version 1.0.2)

spa_boundary_pregion: Capturing the fuzzy boundary of a plateau region object

Description

This function yields a specific part of the fuzzy boundary of a plateau region object.

Usage

spa_boundary_pregion(pregion, bound_part = "region")

Value

A pgeometry object that represents a specific part of the fuzzy boundary of pgeometry object given as input.

Arguments

pregion

A pgeometry object of the type PLATEAUREGION. It throws an error if a different type is given.

bound_part

A character value that indicates the part of the fuzzy boundary to be returned. It can be "region" or "line". See below for more details.

Details

It employs the definition of fuzzy boundary of a fuzzy region object in the context of spatial plateau algebra (as defined in the references). The fuzzy boundary of a fuzzy region object A has a heterogeneous nature since it consists of two parts:

  • a fuzzy line object that corresponds to the boundary of the core of A.

  • a fuzzy region object that comprises all points of A with a membership degree greater than 0 and less than 1.

This means that the function spa_boundary_pregion can yield one specific part of the fuzzy boundary of a plateau region object (the argument pgeometry). If boundary = "line", then the function returns the boundary plateau line of pgeometry (i.e., returns a pgeometry object of the type PLATEAULINE). Else if boundary = "region" (the default value), then the function returns the boundary plateau region of pgeometry (i.e., returns a pgeometry object of the type PLATEAUREGION).

References

Examples

Run this code

library(tibble)
library(FuzzyR)

set.seed(123)

# 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 = 50), 
             z = runif(10, min = 0, max = 100))

classes <- c("category-1", "category-2")
mf1 <- genmf("trapmf", c(0, 5, 20, 35))
mf2 <- genmf("trimf", c(20, 80, 100))

pregions <- spa_creator(tbl, classes = classes, mfs = c(mf1, mf2))
pregions$pgeometry[[1]]
pregions$pgeometry[[2]]

# capturing and showing the boundary plateau line of each pgeometry object previously created
(spa_boundary_pregion(pregions$pgeometry[[1]], bound_part = "line")) 
(spa_boundary_pregion(pregions$pgeometry[[2]], bound_part = "line"))
# the last boundary is empty because there is no core! 

# capturing and showing the boundary plateau region (this is the default behavior)
(spa_boundary_pregion(pregions$pgeometry[[1]]))
(spa_boundary_pregion(pregions$pgeometry[[2]]))

Run the code above in your browser using DataLab