plot.stslist.modst: Plot method for modal state sequences

View source: R/plot.stslist.modst.R

plot.stslist.modstR Documentation

Plot method for modal state sequences

Description

Plot method for output produced by the seqmodst function, i.e objects of class stslist.modst.

Usage

## S3 method for class 'stslist.modst'
plot(x, cpal = NULL, ylab = NULL, yaxis = TRUE,
  xaxis = TRUE, xtlab = NULL, xtstep = NULL, tick.last = NULL,
  info = TRUE, cex.axis = par("cex.axis"), las = 1, cex.plot, ...)

Arguments

x

an object of class stslist.modst as produced by the seqmodst function.

cpal

alternative color palette to use for the states. If user specified, a vector of colors with number of elements equal to the number of states in the alphabet. By default, the 'cpal' attribute of the x object is used.

ylab

an optional label for the y axis. If set to NA, no label is drawn.

yaxis

if TRUE (default) the y axis is plotted.

xaxis

if TRUE (default) the x axis is plotted.

xtlab

optional labels for the x axis ticks. If unspecified, the names attribute of the x object is used.

xtstep

optional interval at which the tick-marks and labels of the x-axis are displayed. For example, with xtstep=3 a tick-mark is drawn at position 1, 4, 7, etc... The display of the corresponding labels depends on the available space and is dealt with automatically. If unspecified, the xtstep attribute of the x object is used.

tick.last

Logical. Should a tick mark be enforced at the last position on the x-axis? If unspecified, the tick.last attribute of the x object is used.

info

Logical: should info about frequency of occurrence of the sequence of modal states be displayed?

cex.axis

Axis annotation magnification. See par.

las

Integer in {0, 1, 2, 3}. Orientation of tick labels. See par.

cex.plot

Deprecated. Use cex.axis instead.

...

further graphical and barplot parameters. See barplot and par.

Details

This is the plot method for output of seqmodst, i.e., for objects of class stslist.modst. It plots the sequence of modal states with bar height proportional to the frequency of the modal state at each successive position.

The method is invoked by seqmsplot (seqplot with type="ms"), which in addition to the modal states automatically displays of the state color legend and allows plotting by group.

See Also

seqmsplot

Examples

## Defining a sequence object with the data in columns 10 to 25
## (family status from age 15 to 30) in the biofam data set
data(biofam)
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.seq <- seqdef(biofam, 10:25, labels=biofam.lab)

## Modal state sequence
biofam.modst <- seqmodst(biofam.seq)
plot(biofam.modst)

TraMineR documentation built on May 29, 2024, 5 a.m.