Skip to contents

Creates a classic funnel plot showing Metric vs Denominator with curved confidence bounds for a single month. Sites are plotted as points colored by their Flag value, with flagged sites labeled.

Usage

Visualize_Funnel(dfFlagged, dfBounds, NMonth = NULL)

Arguments

dfFlagged

A data frame output from Flag() applied to Analyze_TimeZFunnel() output. Must contain columns: GroupID, NMonth, Denominator, Metric, Flag. Must have vFlag attribute (set by gsm.timez::Flag()).

dfBounds

A data frame output from PredictBounds_TimeZFunnel(). Must contain columns: NMonth, Threshold, Denominator, Metric.

NMonth

Optional integer specifying which month to plot. If NULL (default), uses the largest month with at least the minimum fraction of sites active (as specified in Flag() and PredictBounds_TimeZFunnel() via nMinSiteFraction). If provided, must meet the same criterion; an error is raised otherwise.

Value

A ggplot2::ggplot() object.

See also

Analyze_TimeZFunnel() for calculating funnel scores, PredictBounds_TimeZFunnel() for calculating bounds, Visualize_Heatmap() for the heat map visualization across all months.