Extract Vertices Belonging to a Single Basin in a gfc.flow Object
Source:R/gfc_flow.R
basin.vertices.RdReturns the set of domain-graph vertices assigned to a single basin (minimum
or maximum) in a trajectory-first gfc.flow object (as produced by
compute.gfc.flow).
Internally, the function resolves basin.id to an extremum label using
gfc.flow$summary.all (preferred) or gfc.flow$summary, and then
retrieves the basin structure via get.basin. The returned basin
vertex set is basin$vertices.
Arguments
- object
A
gfc.flowobject fromcompute.gfc.flow.- basin.id
Basin identifier. Either:
a character extremum label (e.g.,
"M1","m3","sM2","sm7"), ora single numeric vertex index (1-based) corresponding to an extremum present in
gfc.flow$summary.all/gfc.flow$summary.
- type
Character string. Only used when
basin.idis numeric. One of"auto"(default),"min", or"max". If"auto", the type is inferred from the summary table row matchingbasin.id.- include.extremum
Logical; if TRUE (default), ensure the extremum vertex is included in the returned set (defensive; typically already included).
- unique
Logical; if TRUE (default), return unique vertices.
- sort
Logical; if TRUE (default), sort returned vertices increasingly.
- gfc.flow
Backward-compatible alias for
object.- ...
Additional arguments (currently ignored).
Examples
if (FALSE) { # \dontrun{
## By label
v.M1 <- basin.vertices(gfc.flow.res, "M1")
## By vertex (infer type from summary)
v.1147 <- basin.vertices(gfc.flow.res, 1147)
## By vertex with explicit type (useful if you ever have ambiguity)
v.min.509 <- basin.vertices(gfc.flow.res, 509, type = "min")
} # }