Skip to contents

Merges the output of `stat_anom()` into the anomaly dataframe based on `cluster` ID. The added columns include `t_cen`, `N_anom`, and `t_lag`, which are relocated to appear immediately after the `cluster` column.

Usage

add_stat(proc, stat_table)

Arguments

proc

A dataframe of anomaly detection results, containing a `cluster` column.

stat_table

A dataframe containing cluster-level statistics from `stat_anom()$table`.

Value

A dataframe with added cluster statistics aligned by cluster ID.