powered by
Generate a spaghetti plot to visualize the individual trajectories of a given outcome across time..
getSpaghetti(data, outvar)
A ggplot object displaying the spaghetti plot of individual trajectories.
A data frame containing all variables for the trajectory analysis.
A character vector specifying the outcome variables at different times.
# Example usage: plot <- getSpaghetti( data = symptoms, outvar = paste("sx", seq(from = 0, to = 24, by = 6), sep = "_")) print(plot)
Run the code above in your browser using DataLab