getSpaghetti: Plot individual trajectories of outcome - Spaghetti plot

View source: R/getSpaghetti.R

getSpaghettiR Documentation

Plot individual trajectories of outcome - Spaghetti plot

Description

Generate a spaghetti plot to visualize the individual trajectories of a given outcome across time..

Usage

getSpaghetti(data, outvar)

Arguments

data

A data frame containing all variables for the trajectory analysis.

outvar

A character vector specifying the outcome variables at different times.

Value

A ggplot object displaying the spaghetti plot of individual trajectories.

Examples

# Example usage:
plot <- getSpaghetti(
  data = symptoms,
  outvar = paste("sx", seq(from = 0, to = 24, by = 6), sep = "_"))

print(plot)

MplusLGM documentation built on April 3, 2025, 10:49 p.m.