seqconc {TraMineR} | R Documentation |
Concatenate vectors of states or events into a character string
Description
Concatenate vectors of states or events into a character string. In the string, each state is separated by 'sep'. The void elements in the input sequences are eliminated.
Usage
seqconc(data, var=NULL, sep="-", vname="Sequence", void=NA)
Arguments
data |
A data frame or matrix containing sequence data (tibble will be converted with |
var |
List of the columns containing the sequences. Default is |
sep |
Character used as separator. By default, " |
vname |
an optional name for the variable containing the sequences. By default, |
void |
the code used for void elements appearing in the sequences (see Gabadinho et al. (2009) for more details on missing values and void elements in sequences). Default is |
Value
a vector of character strings, one for each row in the input data.
Author(s)
Alexis Gabadinho
References
Gabadinho, A., G. Ritschard, M. Studer and N. S. Müller (2009). Mining Sequence Data in R
with the TraMineR
package: A user's guide. Department of Econometrics and Laboratory of Demography, University of Geneva.
See Also
Examples
data(actcal)
actcal.string <- seqconc(actcal,13:24)
head(actcal.string)