View source: R/plot.stslist.statd.R
plot.stslist.statd | R Documentation |
This is the plot method for output produced by the seqstatd
function, i.e for objects of class stslist.statd.
## S3 method for class 'stslist.statd'
plot(x, type = "d", cpal = NULL,
ylab = NULL, yaxis = TRUE,
xaxis = TRUE, xtlab = NULL, xtstep = NULL,
tick.last = NULL,
cex.axis = par("cex.axis"),
space = 0, xlab = NULL, lwd=3.5, col="blue",
ylim=NULL, cex.plot, ...)
x |
an object of class |
type |
if |
cpal |
alternative color palette to be used 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 |
ylab |
an optional label for the y axis. If set to NA, no label is drawn. |
yaxis |
Logical. Should the y axis be displayed? Default is |
xaxis |
Logical. Should the x-axis be displayed? Default is |
xtlab |
optional labels for the ticks of the x-axis. If unspecified, the |
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 |
tick.last |
Logical. Should a tick mark be enforced at the last position on the x-axis? If unspecified, the |
cex.axis |
Axis annotation magnification. See |
space |
the space between the stacked bars. Default is 0, i.e. no space. |
xlab |
Optional title for the x axis. See |
lwd |
Width of entropy line. Default is 3.5. Ignored when |
col |
Color of entropy line. Default is |
ylim |
Real vector of length two. Limits of the y-axis for the entropy line. Default is |
cex.plot |
Deprecated. Use |
... |
further graphical parameters such as |
This is the plot method for output produced by the seqstatd
function, i.e. for objects of class stslist.statd. If type="d"
it produces a state distribution plot presenting the sequence of the transversal state frequencies at each successive (time) position, as computed by the seqstatd
function. With type="Ht"
, the series of entropies of the transversal state distributions is plotted.
With type="dH"
the entropy line is overlayed on the state distribution plot.
When ylim=NULL
, ylim
is set as c(0,1)
when entropy is normalized and otherwise as c(0,1.1*max(entropy))
.
This plot method is called by the generic seqplot
function (if type="d"
, type="Ht"
, or "dH"
) that produces more sophisticated plots, allowing grouping and automatic display of the state color legend. The seqdplot
, seqHtplot
, and seqdHplot
functions are aliases for calling seqplot
with type="d"
, type="Ht"
, and dH
respectively.
The plotted values, i.e. for type="d"
the cross-sectional distributions, for type="Ht"
the cross-sectional entropies, and for type="dH"
the x
stslist.statd
object.
Alexis Gabadinho and Gilbert Ritschard
## 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)
## State distribution
biofam.statd <- seqstatd(biofam.seq)
## State distribution plot (default type="d" option)
plot(biofam.statd)
## Entropy index plot
plot(biofam.statd, type="Ht")
## State distribution and entropy line
plot(biofam.statd, type="dH")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.