Skip to contents

Shows the actual extrema (with their function values) that would be retained at different threshold choices. Helps assess whether retained extrema make biological/domain sense.

Usage

# S3 method for class 'retained.extrema'
compare(extrema_df, thresholds = c(2, 3, 4, 5), sort_by = "hop_idx")

Arguments

extrema_df

Data frame with vertex, hop_idx, value, label columns

thresholds

Vector of thresholds to compare

sort_by

Character; how to sort results ("hop_idx", "value", or "vertex")

Value

List of data frames, one per threshold

Examples

extrema_df <- data.frame(
  vertex = 1:5,
  hop_idx = c(1, 3, 5, 7, Inf),
  is_max = c(0, 1, 0, 1, 1),
  label = c("m1", "M1", "m2", "M2", "M3"),
  value = c(0.2, 1.3, 0.4, 1.6, 2.0)
)
retained <- compare.retained.extrema(
  extrema_df,
  thresholds = c(2, 4),
  sort_by = "value"
)
names(retained)