getSpaghetti {MplusLGM} | R 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)
[Package MplusLGM version 1.0.0 Index]