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

plot.stslist.meant | R Documentation |

This is the plot method for objects of class *stslist.meant* produced by the `seqmeant`

function.

## S3 method for class 'stslist.meant' plot(x, cpal = NULL, ylab = NULL, yaxis = TRUE, xaxis = TRUE, cex.axis = 1, ylim = NULL, bar.labels = NULL, cex.barlab = cex.axis, offset.barlab = .1, cex.plot, ...)

`x` |
an object of class |

`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 ' |

`ylab` |
an optional label for the y axis. If set to |

`yaxis` |
controls whether the y axis is plotted. Default is |

`xaxis` |
if |

`cex.axis` |
Axis annotation magnification. See |

`ylim` |
an optional vector setting the limits for the y axis. If |

`bar.labels` |
Vector of bar labels of length equal to size of alphabet. |

`cex.barlab` |
Real. Bar labels magnification. Defaults to |

`offset.barlab` |
Real. Vertical offset of bar labels as a proportion of |

`cex.plot` |
Deprecated. Use |

`...` |
further graphical parameters. For more details about the graphical parameter arguments, see |

This is the plot method for the output produced by the `seqmeant`

function, i.e., objects of class *stslist.meant*. It produces a plot showing the mean times spent in each state of the alphabet.

When the `"se"`

attribute of `x`

is `TRUE`

, i.e., when `x`

contains also the standard errors of the mean times, error bars are automatically displayed on the plot. See the `serr`

argument of `seqmeant`

.

This method is called by the generic `seqplot`

function (if `type="mt"`

) that produces more sophisticated plots, allowing grouping and automatic display of the states legend. The `seqmtplot`

function is a shortcut for calling `seqplot`

with `type="mt"`

.

## Loading the mvad data set and creating a sequence object data(mvad) mvad.labels <- c("employment", "further education", "higher education", "joblessness", "school", "training") mvad.scodes <- c("EM","FE","HE","JL","SC","TR") mvad.seq <- seqdef(mvad, 15:86, states=mvad.scodes, labels=mvad.labels) ## Computing the mean times mvad.meant <- seqmeant(mvad.seq) ## Plotting plot(mvad.meant, main="Mean durations in each state of the alphabet") ## Changing the y axis limits plot(mvad.meant, main="Mean durations in each state of the alphabet", ylim=c(0,40)) ## Displaying error bars mvad.meant.e <- seqmeant(mvad.seq, serr=TRUE) plot(mvad.meant.e, main="Mean durations in each state of the alphabet", ylim=c(0,40))

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.