- data
A long-format data.frame (one row per subject-occasion).
- id
Character. Column name in data identifying the subject.
- time
Character. Column name for the time / occasion variable
(the x axis).
- outcome
Character. Column name for the outcome / score variable
(the y axis).
- group
Optional character. Column name for a grouping variable used
to color the trajectories (and panels, if faceted).
- ids
Optional vector of subject IDs to plot.
- n_random
Optional integer; randomly sample this many subjects.
- pct_random
Optional numeric; sample this percentage of subjects.
Values \(\leq 1\) are interpreted as proportions; values
\(> 1\) as percentages. At most one of ids, n_random,
or pct_random may be supplied.
- facet
Logical. If TRUE, draw one panel per subject via
facet_wrap. If FALSE (default), overlay all
trajectories in one panel.
- nrow, ncol
Optional integers passed to facet_wrap() when
facet = TRUE.
- show_points
Logical. If TRUE (default), draw the observed
points as well as the connecting lines.
- point_size
Size of the observed points (default 1.5).
- linewidth
Line width for the connecting segments (default 0.5).
- alpha
Transparency for points and lines (default 0.7).
- palette
Character string naming the color palette used to color the
trajectories when group is a discrete (factor, character, or
logical) variable. Defaults to "okabe_ito", base R's
colorblind-safe Okabe-Ito palette; "tableau" is also available.
Ignored when group is NULL or numeric.
- title, xlab, ylab
Optional plot labels. Sensible defaults are taken
from outcome and time when these are NULL.
- seed
Optional integer random seed used when
n_random or pct_random is supplied. Defaults to
NULL, which leaves the user's current RNG state intact;
supply an integer for reproducible subject sampling.