Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seqdecomp

Convert a character string into a vector of states or events


Description

For the moment, each character in the string will be considered to be one state or event = this function will not give accurate results if the character string representing the sequence contains events or states coded with more than one character.

Usage

seqdecomp(data, var=NULL, sep='-', miss="NA", vnames=NULL)

Arguments

data

a dataframe or matrix containing sequence data.

var

the list of columns containing the sequences. Default is NULL, ie all the columns. Whether the sequences are in the compressed (character strings) or extended format is automatically detected by counting the number of columns.

sep

the between states/events separator used in the input data set. Default is '-'.

miss

the symbol for missing values (if any) used in the input data set. Default is NA.

vnames

optional names for the column/variables of the output data set. Default is NULL.

See Also

Examples

## Converts 'seq' into a vector of states of length 10
seq <- "A-A-A-A-B-B-B-C-C-C"
seqdecomp(seq)

TraMineR

Trajectory Miner: a Toolbox for Exploring and Rendering Sequences

v2.2-1
GPL (>= 2)
Authors
Alexis Gabadinho [aut, cph], Matthias Studer [aut, cph] (<https://orcid.org/0000-0002-6269-1412>), Nicolas M"{u}ller [aut], Reto B"{u}rgin [aut], Pierre-Alexandre Fonta [aut], Gilbert Ritschard [aut, cre, cph] (<https://orcid.org/0000-0001-7776-0903>)
Initial release
2020-10-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.