getSpaghetti | R Documentation |
Generate a spaghetti plot to visualize the individual trajectories of a given outcome across time..
getSpaghetti(data, outvar)
data |
A data frame containing all variables for the trajectory analysis. |
outvar |
A character vector specifying the outcome variables at different times. |
A ggplot object displaying the spaghetti plot of individual trajectories.
# Example usage:
plot <- getSpaghetti(
data = symptoms,
outvar = paste("sx", seq(from = 0, to = 24, by = 6), sep = "_"))
print(plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.