Chapter 02

Defining, Describing, and Visualizing Sequences

TOC Content (click for jumping to examples)
2.1 Basic Concepts and Terminology Sequence data formats
2.2 Defining Sequences Sequence length and granularity
2.3 Description of Sequence Data I Basic Description
2.4 Visualization of Sequence Data Color palette: Grayscale Edition
Color palette: Colored Edition
2.4.1 Data summarization graphs
2.4.2 Data representation graphs
ggplotify sequence data plots (bonus material)
2.5 Description of Sequence Data II Unidimensional and composite indices

Chapter 2 introduces the basic concepts and discusses how to define sequence data. The corresponding material provided on this site shows {TraMineR}’s capabilities of processing different data formats. We further illustrate how the alphabet and the granularity of sequences can be easily changed with {TraMineR}’s built-in helper functions.

With visualization being one of the key features of sequence analysis, we provide extensive material on optimizing the quality of figures by choosing appropriate color palettes. Although we highly recommend using colors for visualizing sequences, the associated print-costs are often prohibitively high (for instance, in the case of our book). We therefore provide some material illustrating how to produce acceptable results by using a grayscale color palette and by adding texture.

We further show useful commands for a comprehensive description of the sequence data. Finally, we turn to more advanced composite measures of sequence complexity. These indices are not only interesting in themselves, but also because they can be used either as independent or as dependent variable in subsequent regression analyses.


If you see mistakes or want to suggest changes, please create an issue on the source repository.


Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. Source code is available at, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".