Skip to contents

Creates a line plot highlighting a single site's cumulative metric trajectory against all other sites, with colored dots marking flagged months.

Usage

Visualize_Site(dfFlagged, dfBounds = NULL, strSiteID)

Arguments

dfFlagged

A data frame output from Flag() containing columns: GroupID, NMonth, Metric, Flag, and (when dfBounds is provided) Denominator. Must carry vFlag and vThreshold attributes (set by gsm.timez::Flag()).

dfBounds

Optional. A data frame with pre-calculated funnel bounds from PredictBounds_TimeZFunnel(). If provided, inner threshold lines are drawn for the selected site based on its denominator at each month. If NULL (default), no bounds are shown.

strSiteID

Character string specifying the site ID to highlight. Must exist in dfFlagged$GroupID.

Value

A ggplot2::ggplot() object.

See also

Flag() for assigning flag categories, PredictBounds_TimeZFunnel() for calculating bounds, Visualize_Heatmap() for the heat map visualization.