ctIndplot: ctIndplot

View source: R/ctIndplot.R

ctIndplotR Documentation

ctIndplot

Description

Convenience function to simply plot individuals trajectories from ctsem wide format data

Usage

ctIndplot(
  datawide,
  n.manifest,
  Tpoints,
  n.subjects = "all",
  colourby = "variable",
  vars = "all",
  opacity = 1,
  varnames = NULL,
  xlab = "Time",
  ylab = "Value",
  type = "b",
  start = 0,
  legend = TRUE,
  legendposition = "topright",
  new = TRUE,
  jittersd = 0.05,
  ...
)

Arguments

datawide

ctsem wide format data

n.manifest

Number of manifest variables in data structure

Tpoints

Number of discrete time points per case in data structure

n.subjects

Number of subjects to randomly select for plotting, or character vector 'all'.

colourby

set plot colours by "subject" or "variable"

vars

either 'all' or a numeric vector specifying which manifest variables to plot.

opacity

Opacity of plot lines

varnames

vector of variable names for legend (defaults to NULL)

xlab

X axis label.

ylab

Y axis label.

type

character specifying plot type, as per usual base R plot commands. Defaults to 'b', both points and lines.

start

Measurement occasion to start plotting from - defaults to T0.

legend

Logical. Plot a legend?

legendposition

Where to position the legend.

new

logical. If TRUE, creates a new plot, otherwise overlays on current plot.

jittersd

positive numeric indicating standard deviation of noise to add to observed data for plotting purposes.

...

additional plotting parameters.

Examples


data(ctExample1)
ctIndplot(ctExample1,n.subjects=1, n.manifest=2,Tpoints=6, colourby='variable')


ctsem documentation built on Sept. 11, 2024, 9:06 p.m.