Skip to contents

Extracts 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. If FALSE, exclude it.

...

Additional arguments (currently ignored).

Value

A numeric vector of vertex indices in the extremum's neighborhood.

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")