Summarize Local Extrema
Arguments
- object
A
local_extremaobject fromdetect.local.extrema().- ...
Unused.
- x
A
summary.local_extremaobject returned bysummary().
Value
summary() returns a list of class summary.local_extrema with
n_extrema, extrema_type, summaries of function values, neighborhood
sizes and radii, and the data frame extrema_details (labels, vertex
indices, values, radii and neighborhood sizes). With no extrema, numerical
summaries are NA and the data frame is empty; the type is NA for legacy
empty objects without detection-type metadata. print() prints this
summary and invisibly returns x unchanged.
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)
summary(extrema)
#> Local Extrema Detection Summary
#> ==============================
#>
#> Extrema type: Maximum
#> Number of extrema found: 2
#>
#> Top extrema by function value:
#> label vertex_index fn_value radius neighborhood_size
#> 1 M1 2 3 1 3
#> 2 M2 4 2 1 3
print(summary(extrema))
#> Local Extrema Detection Summary
#> ==============================
#>
#> Extrema type: Maximum
#> Number of extrema found: 2
#>
#> Top extrema by function value:
#> label vertex_index fn_value radius neighborhood_size
#> 1 M1 2 3 1 3
#> 2 M2 4 2 1 3