seqfcheck {TraMineR} | R Documentation |
Check wheter seqdata contains sequences in the compressed format (as character strings, with states separated by a separator) or in the extended format (sequences are stored in a matrix, where each state is stored in a separate column of the matrix. For a more detailed description of the compressed and extended format, see Gabadinho, 2008.
seqfcheck(seqdata)
seqdata |
a vector, data frame or matrix containing sequence data. |
Wether the sequence(s) are in compressed format is checked by counting the number of columns and searching for the '-' or ':' separator. The function returns the separator if it has been found in the data. If the data contains more than one column, the data is supposed to be in the extended format, and 'X' is returned, unless some states codes contain the '-' character (eg. states coded with negative integer values), in which case '-X' is returned.
a character string coding the format of the sequence data, either ':', '-', 'X' or '-X'.
Gabadinho, A., G. Ritschard, M. Studer and N. S. Müller (2008). Mining Sequence Data in R
with TraMineR
: A user's guide. Department of Econometrics and Laboratory of Demography, University of Geneva.
## The sequences in the actcal data set ## are in the extended format data(actcal) seqfcheck(actcal[,13:24]) ## The sequences in the famform data set ## are in the extended format data(famform) seqfcheck(famform)