spaghettiogram: Spaghettiogram

View source: R/Spaghettiogram.R

spaghettiogramR Documentation

Spaghettiogram

Description

A spaghettiogram is showing repeated measures (longitudinal data)

Usage

spaghettiogram(
  formula,
  data,
  xlim,
  ylim,
  xlab = "",
  ylab = "",
  axes = TRUE,
  col,
  lwd,
  lty,
  pch,
  legend = FALSE,
  add = FALSE,
  background = TRUE,
  ...
)

Arguments

formula

A formula which specifies the variables for the spaghettiograms. If Y ~ X + id(Z) then for each value of Z the spaghettiogram is the graph (X,Y) in the subset defined by the value of Z. Data are expected to be in the "long" format. Y is a numeric vector and X is a factor whose levels define the X-axis. Each level of the id-vector corresponds to one line (spaghetti) in the plot.

data

data set in which variables X, Y and Z are defined.

xlim

Limits for x-axis

ylim

Limits for y-axis

xlab

Label for x-axis

ylab

Label for x-axis

axes

Logical indicating if axes should be drawn.

col

Colors for the spaghettiograms

lwd

Widths for the spaghettiograms

lty

Type for the spaghettiograms

pch

Point-type for the spaghettiograms

legend

If TRUE add a legend. Argument A of legend is controlled as legend.A. E.g., when legend.cex=2 legend will be called with argument cex=2.

add

If TRUE add to existing plot device.

background

Control the background color of the graph.

...

used to transport arguments which are passed to the following subroutines: "plot", "lines", "legend", "background", "axis1", "axis2".

Value

List with data of each subject

Examples


data(SpaceT)
Spaghettiogram(HR~Status+id(ID),
               data=SpaceT)

Publish documentation built on Jan. 18, 2023, 1:08 a.m.