Skip to contents

Creates a ggplot2 visualization from the output of functional_group_summary(). The plotted values reflect the smoothing method chosen when that summary object was created.

Usage

plot_functional_means(
  summary,
  title = "Functional mean curves by group",
  xlab = "Time",
  ylab = "Mean value",
  legend_title = "Group",
  palette = NULL,
  highlight_intervals = NULL
)

Arguments

summary

A list returned by functional_group_summary() or a data frame with group, time, and mean_value columns.

title

Plot title.

xlab

Label for the x-axis.

ylab

Label for the y-axis.

legend_title

Legend title for the grouping variable.

palette

Optional named vector of colors.

highlight_intervals

Optional data frame with start and end columns used to shade one or more intervals.

Value

A ggplot2 object.