Extract Vertices of a Specific Local Extremum
Source:R/local_extrema.R
vertices.gflow_local_extrema.RdExtracts the vertices belonging to a specific local extremum identified by its label. Returns all vertices in the neighborhood of the specified extremum.
Usage
# S3 method for class 'gflow_local_extrema'
vertices(object, label, include.center = TRUE, ...)Arguments
- object
An object of class
"gflow_local_extrema".- label
Character string specifying the label of the extremum (e.g., "M1", "m2").
- include.center
Logical; if
TRUE(default), include the center vertex exactly once, adding it if absent. IfFALSE, exclude it.- ...
Additional arguments (currently ignored).
Note
This method requires that the C++ backend provides neighborhood vertex
information in the neighborhood_vertices component of the result.
Examples
extrema <- list(
vertices = c(4L, 2L),
values = c(5, 3),
radii = c(2, 1),
neighborhood_sizes = c(3L, 2L),
is_maxima = c(TRUE, TRUE),
type = c("Maximum", "Maximum"),
labels = c("M1", "M2"),
neighborhood_vertices = list(c(3L, 5L, 2L), c(1L, 3L)),
detect.maxima = TRUE
)
class(extrema) <- "gflow_local_extrema"
vertices(extrema, "M1")