A set of wrapper functions that reproduces most of the
sequence plots rendered with TraMineR::seqplot() and several related
plots from 'TraMineR' and 'TraMineRextras' (Gabadinho et al. 2011,

The main goal of {ggseqplot}
is to provide functions that reproduce the sequence plots from
{TraMineR}’s seqplot using
{ggplot2}. These plots are produced on
the basis of state sequence objects defined with TraMineR::seqdef
(and, for some functions, on the basis of event sequence objects or
regression trees of sequences). The package automates the reshaping and
plotting of sequence data. This library builds on the excellent work of
the {TraMineR} and
{ggplot2} developers and uses several
of their functions to produce ggplot2-flavored figures.
Note that this library was not written because I personally dislike the
plots produced by {TraMineR}, but rather because I
normally use {ggplot2} instead of base R’s plot
environment for data visualization.
{TraMineR} was developed before
{ggplot2} became as popular as it is
today, when most users were more familiar with base R plots. Today,
however, many researchers and students prefer to use
{ggplot2} and draw on their existing
skills rather than learn base R graphics just to visualize sequence
data.
{ggseqplot} contains the
following functions:
ggseqdplot (equivalent to TraMineR::seqdplot)ggseqeplot (equivalent to TraMineRextras::seqplot.tentrop)ggseqmsplot (equivalent to TraMineR::seqmsplot)ggseqmtplot (equivalent to TraMineR::seqmtplot)ggseqtrplot (based on transition rates from TraMineR::seqtrate)ggseqimplicplot (equivalent to the plot method of
TraMineRextras::seqimplic)ggseqiplot (equivalent to TraMineR::seqIplot)ggseqfplot (equivalent to TraMineR::seqfplot)ggseqrplot (equivalent to TraMineR::seqrplot)ggseqrfplot (equivalent to TraMineRextras::seqplot.rf)ggseqpcplot (equivalent to TraMineR::seqpcplot)ggseqtreeplot (equivalent to TraMineR::seqtreedisplay, but without
requiring an installation of GraphViz)A complementary
vignette
outlines how {ggseqplot}
reshapes sequence data generated with
{TraMineR} functions for visualization
with {ggplot2}. It also shows how to
customize the plots using familiar
{ggplot2} functions and extensions.
If you find errors or have feature requests, feel free to create an issue on GitHub or send me an email.
If you use {ggseqplot}
in your work, please cite it as:
Raab, M. (2022). ggseqplot: Render Sequence Plots using ‘ggplot2’. https://doi.org/10.32614/CRAN.package.ggseqplot
You can also retrieve the citation in R with:
citation("ggseqplot")
You can install the CRAN version of
{ggseqplot} with:
install.packages("ggseqplot")
If a more recent version is available, you can install the development version from GitHub with:
devtools::install_github("maraab23/ggseqplot")
I would like to thank Gilbert Ritschard, Tim Liao, and Emanuela Struffolino for their helpful comments on earlier versions of this library.
The functions ggseqimplicplot, ggseqpcplot, and ggseqtreeplot
(added in version 1.0.0) were written with the assistance of the AI
coding tool
Claude Code
(Anthropic). The generated code, documentation, and tests were reviewed,
revised, and tested by the package maintainer.