trajPlot | R Documentation |
trajPlot
will plot individual subject trajectories for multi-batch longitudinal data. Each line represents a trajectory of observations of a single feature (e.g., left fusiform cortical thickness) over time for an individual subject. Plotting points are coded by batch. Data should be in "long" format.
trajPlot( idvar, timevar, feature, batchvar, data, point.shape = NULL, point.col = NULL, line.col = NULL, line.type = NULL, xlabel = "time", ylabel = "feature", title = "", xlimits = NULL, ylimits = NULL, margins = c(5, 5, 3, 1), verbose = TRUE, ... )
idvar |
character string that specifies name of ID variable. ID variable can be factor, numeric, or character. |
timevar |
character string that specifies name of numeric variable that distinguishes within-subject repeated measures, e.g., time, age, or visit. Will be plotted along x-axis. |
feature |
character string that specifies name of the numeric feature variable to be plotted over time, or the numeric index of the corresponding column. Will be plotted along y-axis. |
batchvar |
character string that specifies name of the batch variable. Batch variable should be a factor. Will determine the shape of plotting points. |
data |
name of the data frame that contains the variables above. Rows are different observations (subject/timepoints), columns are different variables. |
point.shape |
optional numeric vector that encodes the point shape for the batch variable levels. If not using default setting, length should be equal to number of unique observations included ( |
point.col |
optional vector that encodes colors of the point for each observation (character string of color names or hexadecimal codes). Length should be equal to number of unique observations included ( |
line.col |
optional vector that encodes colors of the line for each subject (character string of color names or hexadecimal codes). Length should be equal to number of unique subjects included ( |
line.type |
optional numeric or character vector that encodes line type for each subject. Length should be equal to number of unique subjects included ( |
xlabel |
x-axis label (character string). Default is |
ylabel |
y-axis label (character string). Default is |
title |
main title for the plot (character string). Default is no title. |
xlimits |
two dimensional numeric vector giving minimum and maximum x-axis values. Default is minimum and maximum time variable values. |
ylimits |
two dimensional numeric vector giving minimum and maximum y-axis values. Default is minimum and maximum feature variable values. |
margins |
numeric vector of 4 values specifying margins in the order (bottom, left, top, right). |
verbose |
prints messages. Logical |
... |
other graphical parameter arguments passed to |
Creates a plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.