Skip to contents

Extract a Local-Extremum Neighborhood

Usage

# S3 method for class 'local_extrema'
vertices(object, label, include.center = TRUE, ...)

Arguments

object

Object from which vertices should be extracted.

label

Character scalar identifying an extremum in object$labels.

include.center

Logical; include the extremum vertex itself.

...

Additional arguments passed to methods.

Value

An integer vector of one-based vertex indices in the selected extremum's stored neighborhood, optionally excluding its center.

Examples

chain <- create.graph("chain", n = 5)
extrema <- detect.local.extrema(graph.adjacency(chain), graph.lengths(chain), y = c(1, 3, 1, 2,
    0), max.radius = 1, min.neighborhood.size = 2)
vertices(extrema, extrema$labels[[1]])
#> [1] 1 2 3