- data
a data frame, matrix, or character string vector containing sequence data (tibble will be converted with as.data.frame
).
- var
the list of columns containing the sequences. Default is
NULL
, i.e. all the columns. The function detects automatically
whether the sequences are in the compressed (successive states in a
character string) or extended format.
- informat
format of the original data. Default is "STS"
.
Other available formats are: "SPS"
and "SPELL"
, in which case the seqformat
function is called to convert the data into the "STS"
format (see TraMineR user's manual (Gabadinho et al., 2010) for a
description of these formats). A better solution is nonetheless to convert first your
data with seqformat
, so as to have better control over the conversion process and visualize the intermediate "STS"
formatted data.
- stsep
the character used as separator in the original
data if input format is successive states in a character string. If
NULL
(default value), the seqfcheck
function is
called for detecting automatically a separator among "-" and ":".
Other separators must be specified explicitly.
- alphabet
optional vector containing the alphabet (the list of all possible states). Use this option if some states in the alphabet don't appear in the data or if you want to reorder the states. The specified vector MUST contain AT LEAST all the states appearing in the data. It may possibly contain additional states not appearing in the data. If NULL
, the alphabet is set to the distinct states appearing in the data as returned by the seqstatl
function. See details.
- states
an optional vector containing the short state labels. Must have a length equal to the size of the alphabet and the labels must be ordered conformably with alpha-numeric ordered values returned by the seqstatl
function, or, when alphabet=
is set, with the thus newly defined alphabet.
- id
optional argument for setting the rownames of the sequence object. If NULL
(default), the rownames are taken from the input data. If set to "auto"
, sequences are numbered from 1 to the number of sequences. A vector of rownames of length equal to the number of sequences may be specified as well.
- weights
optional numerical vector containing weights, which are taken into account by plotting and statistical functions when applicable. Weights must be non-negative and cannot be NA
.
- start
starting time. For instance, if sequences begin
at age 15, you can specify 15. At this stage, used only for labelling column names.
- left
the behavior for missing values appearing before the
first (leftmost) valid state in each sequence. When NA
(default),
left missing values are treated as 'real' missing values and converted to the
internal missing value code defined by the nr
option. Other
options are "DEL"
to delete the positions containing missing values
or a state code (belonging to the alphabet or not) to replace the
missing values. See Gabadinho et
al. (2010) for more details on the options for handling missing
values when defining sequence objects.
- right
the behavior for missing values appearing after the
last (rightmost) valid state in each sequence. Same options as for
the left
argument. Default is 'DEL'
.
- gaps
the behavior for missing values appearing inside the
sequences, i.e. after the first (leftmost) valid state and before the
last (rightmost) valid state of each sequence. Same options as for
the left
argument. Default is NA
.
- missing
the code used for missing values in the input
data. Default is NA
. When any other value, all cells containing this value are treated
as NA
s and replaced by nr
or void
code according to the
left
, gaps
, and right
options.
- void
the internal
code used by TraMineR for representing void elements in the
sequences. Default is "%"
. Must be different from left
, gaps
, and right
.
- nr
the internal code used by TraMineR for representing real
missing elements in the sequences. Default is "*"
.
- cnames
optional names for the columns composing the
sequence data. Those names will be used by default in the graphics as
axis labels. If NULL
(default), names are taken from the
original column names in the data.
- xtstep
step between displayed tick-marks and labels on the time x-axis of state sequence plots.
If not overridden by the user, plotting functions retrieve this parameter from the xtstep
attribute of the sequence object. For example, with xtstep=3
a tick-mark is displayed at positions 1, 4, 7, etc... Default value is 1; i.e., a tick mark is displayed at each position. The display of the corresponding labels depends on the available space and is dealt with automatically.
- tick.last
Logical. Should a tick mark be enforced at the last position on the time x-axis?
- cpal
an optional color palette for representing the states
in the graphics. If NULL
(default), a color palette is created
by means of the brewer.pal
function of the RColorBrewer
package for number of states up to 12. When the number of states is less or equal than 8, the
"Accent"
palette is used. If number of states is between 8 and
12, the "Set3"
palette is used. When the number of states is greater than 12,
colors are set using hcl.colors
with
the "Set 3" palette. To specify your own palette use e.g. the colors
function, or the RColorBrewer or colorspace packages.
- missing.color
alternative color for representing missing
values inside the sequences. Defaults to "darkgrey"
.
- labels
optional state labels used for the color legend of
TraMineR's graphics. If NULL
(default), the state names in the
alphabet are used as state labels as well.
- ...
options passed to the seqformat
function
for handling input data that is not in STS format.