This function gets or sets the state labels of a sequence object, that is, the long labels used when displaying the state legend in plotting functions.
a state sequence object as defined by the
a vector of character strings containing the labels, of length equal to the number of states in the alphabet. Each string is attributed to the corresponding state in the alphabet, the order being the one returned by the
The state legend is plotted either automatically by the plot functions provided for visualizing sequence objects or with the
seqlegend function. A long label is associated to each state of the alphabet and displayed in the legend. The state labels are defined when creating the sequence object, either automatically using the values found in the data or by specifying a user defined vector of labels. The
stlab function can be used to get or set the state labels of a previously defined sequence object.
For 'stlab' a vector containing the labels.
For 'stlab<-' the updated sequence object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
## Creating a sequence object with the columns 13 to 24 ## in the 'actcal' example data set ## The color palette is automatically set data(actcal) actcal.seq <- seqdef(actcal,13:24) ## Retrieving the color palette stlab(actcal.seq) seqiplot(actcal.seq) ## Changing the state labels stlab(actcal.seq) <- c("Full time","Part time (19-36 hours)", "Part time (1-18 hours)", "No work") seqiplot(actcal.seq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.