| plot.stslist.freq {TraMineR} | R Documentation |
Plot method for output produced by the seqmeant function, i.e objects of class stslist.freq.
## S3 method for class 'stslist.freq': plot(x, cpal = NULL, missing.color = NULL, pbarw = TRUE, ylab = NULL, yaxis = TRUE, xaxis = TRUE, xtlab = NULL, cex.plot = 1, ...)
x |
an object of class stslist.freq as produced by the seqtab 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. |
missing.color |
alternative color for representing missing values inside the sequences. By default, this color is taken from the missing.color attribute of the object being plotted. |
pbarw |
if pbarw=TRUE (default), the width of the bars are proportional to the sequence frequency in the dataset. |
ylab |
an optional label for the y axis. If set to NA, no label is drawn. |
yaxis |
if TRUE or "cum", the y axis is plotted with a label showing the cumulated percentage frequency of the displayed sequences. If "pct", the percentage value for each sequence is displayed. |
xaxis |
if TRUE (default) the xaxis is plotted. |
xtlab |
optional labels for the x axis ticks. If unspecified, the names attribute of the x object is used. |
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. |
... |
further graphical parameters. For example border=NA to remove the bars borders, space=0 to remove space between sequences. For more details about the graphical parameter arguments, see barplot and par. |
This is the plot method for the output produced by the seqtab function, i.e. objects of class stslist.freq. It produces a plot showing the sequences sorted bottom up according to their frequency in the data set.
This method is called by the generic seqplot function (if type="f") that produces more sophisticated plots, allowing grouping and automatic display of the states legend. The seqfplot function is a shortcut for calling seqplot with type="f".
## Loading the 'actcal' example data set
data(actcal)
## Defining a sequence object with data in columns 13 to 24
## (activity status from january to december 2000)
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal, 13:24, labels=actcal.lab)
## 10 most frequent sequences in the data
actcal.freq <- seqtab(actcal.seq, tlim=10)
## Plotting the object
plot(actcal.freq, main="Sequence frequencies - actcal data set")
## Plotting all the distinct sequences without borders
## and space between sequences
actcal.freq2 <- seqtab(actcal.seq, tlim=0)
plot(actcal.freq2, main="Sequence frequencies - actcal data set",
border=NA, space=0)