Learn R Programming

TraMineR (version 1.1)

seqdplot: Plot the sequence of state distributions

Description

Graphic presenting the states frequencies for each time unit, as computed by the seqstatd function.

Usage

seqdplot(seqdata, group=NULL, title=NULL, 
	cpal=NULL, withborder=TRUE, 
	ylab, axes="all", xtlab=NULL, cex.plot=1,
	withlegend="auto", ltext=NULL, cex.legend=1,
	use.layout=(!is.null(group) | withlegend!=FALSE), 
	legend.prop=NA, rows=NA, cols=NA, ...)

Arguments

seqdata
a sequence object as defined by the seqdef function.
group
plots one plot for each level of the factor given as argument.
title
a character string giving the title for the graphic. Default to no title.
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 distinct states. By default, the 'cpal' attribute of the 'seqdata' sequence object is used (see
withborder
Now obsolete. Standard option 'border=NA' can be used (see ... optional arguments below) to omit borders around the bars.
ylab
An optional label for the y axis. If set to NA, no label is drawn.
axes
if set to "all" (default value) x axes are drawn for each plot in the graphic. If set to "bottom" and group is used, axes are drawn only under the plots located at the bottom of the graphic area. If FALSE, no x axis is drawn.
cex.plot
expansion factor for setting the size of the font for the axis labels and names. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase the size.
xtlab
optional labels for the x axis ticks labels. If unspecified, the column names of the 'seqdata' sequence object are used (see seqdef).
withlegend
set wether a legend for the states colors is plotted. The default value 'auto' sets the position of the legend automatically. Other options are 'right'. Obsolete option 'TRUE' is identical to 'auto'.
ltext
optional description of the states to appear in the legend. Must be a vector of character strings with number of elements equal to the number of distinct states. If unspecified, the 'label' attributes of the 'seqdata' sequence object is used (see
cex.legend
expansion factor for setting the size of the font for the labels in the legend. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase the size.
use.layout
if TRUE, layout is used to arrange plots when using the group option or plotting a legend. If layout is used, the standard 'par(mfrow=....)' for arranging plots will not work anymore. If withlegend is FALSE and group is NULL, layout is automatically deact
legend.prop
sets the proportion of the graphic area used for plotting the legend when use.layout=TRUE and withlegend=TRUE. Default value is set according to the place (bottom or right of the graphic area) where the legend is plotted. Values
rows,cols
optional arguments to arrange plots when use.layout=TRUE.
...
arguments to be passed to the plot function or other graphical parameters.

See Also

seqstatd

Examples

Run this code
## Loading the 'biofam' example data set
data(biofam)

## Defining a sequence object with the data in columns 10 to 25
## (family status from age 15 to 30)
biofam.seq <- seqdef(biofam, 10:25)

## Plotting the states distribution (family status from age 15 to 30)
seqdplot(biofam.seq)

## Grouped by fathers' SES
seqdplot(biofam.seq, group=biofam$cspfaj, axes="bottom")

Run the code above in your browser using DataLab