Extracting data from TraMineR for use in other plotting packages (e.g. ggplot2)

392 Views Asked by At

I am writing a paper using TraMineR for sequence plotting and ggplot for the remaining graphs. I would like to extract the data that seqIplot( ) uses to create index plots and use it to make an index plot using geom_tile( ), for the sake of maintaining the same visual style. How should I go about it?

1

There are 1 best solutions below

0
On BEST ANSWER

All the information (sequences, alphabet, color palette, short and long state labels, position labels, ...) used by seqIplot is in the state sequence object you define with seqdef from your raw data.

So just explore your object using attributes

library(TraMineR)
data(mvad)
## create a state sequence object from columns 17 to 86
mvad.seq <- seqdef(mvad[,17:86])
attributes(mvad.seq)

Hope this helps