Skip to contents

Automatically Plot Trajectories of Variables Selected by prolong()

Usage

plot_trajectories(
  x,
  object = NULL,
  selected = NULL,
  timelabs = NULL,
  colors = "#00BFC4"
)

Arguments

x

Input covariate array, with n rows, p columns, and t slices

object

A prolong model object. Can be left NULL if selected is provided

selected

A character list of variable names or a numeric index of variables of interest whose trajectories are to be plotted. Can be left NULL if object is provided

timelabs

Optional numeric or character vector of labels for the t time points. If left NULL, 1:t will be used

colors

Either a single color to plot all trajectories or an n length vector with a color for each subject

Value

A 2d sequence of trajectory plots from facet_wrap()

Examples

if (FALSE) {
promod <- prolong(Ymatrix, Xarray)
plot_trajectories(Xarray, promod)
plot_trajectories(Xarray, selected = promod$selected)
}