plot_paths: Plot panel trajectories

View source: R/plot_paths.R

plot_pathsR Documentation

Plot panel trajectories

Description

Plots multiple trajectories from panel or longitudinal data grouped by unit.

Usage

plot_paths(df,
  col = NULL,
  lwd = 1,
  xlab = "t",
  ylab = "Y",
  main = NULL,
  ...)

Arguments

df

Data frame containing the observed data. It must include the columns t (time), unit (unit identifier) and Y (observed values).

col

Optional vector of colors, one per unit. If NULL, a grayscale palette is used.

lwd

Line width used for the trajectories.

xlab

Label for the x-axis.

ylab

Label for the y-axis.

main

Optional main title for the plot.

...

Additional graphical parameters passed to plot.

Value

A ggplot graph.

Examples

data(datasim02)
plot_paths(datasim02)

mixediffusion documentation built on March 20, 2026, 5:10 p.m.