seqformat(data, var=NULL, id=NULL,
from, to, compressed=FALSE,
nrep=NULL, tevent, stsep=NULL, covar=NULL,
SPS.in=list(xfix="()", sdsep=","),
SPS.out=list(xfix="()", sdsep=","),
begin=NULL, end=NULL, status=NULL,
process=TRUE, pdata=NULL, pvar=NULL,
limit=100, overwrite=TRUE,
fillblanks=NULL, tmin=NULL, tmax=NULL)
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.SPELL
format as input, this identification number is mandatory, in order to identify all spells belonging to each individual in the data set.data
is a sequence object, format is automatically set to STS
.NULL
(default value), the seqfcheck
function is called for detecting automatically a process=TRUE
, either NULL, "auto" or the name of the data frame containing the individual 'birth' time, that is, the entering time from which the process time will be computed. If set to NULL
(defauseqdef
function therefore).
See Gabadinho et al. (2009) and Ritschard et al. (2009) for more details on longitudinal data formats and translation between them.R
with TraMineR
: A user's guide. Department of Econometrics and Laboratory of Demography, University of Geneva.Ritschard, G., A. Gabadinho, M. Studer and N. S. M�ller. Converting between various sequence representations. in Ras, Z. & Dardzinska, A. (ed.) Advances in Data Management, Springer, 2009, 223, 155-175
seqdef
## Converting sequences into SPS format
data(actcal)
actcal.SPS.A <- seqformat(actcal,13:24, from="STS", to="SPS")
head(actcal.SPS.A)
## SPS (compressed) format with no prefix/suffix "/" as state/duration separator
actcal.SPS.B <- seqformat(actcal,13:24,
from="STS", to="SPS", compressed=TRUE,
SPS.out=list(xfix="", sdsep="/"))
head(actcal.SPS.B)
## Converting sequences into DSS (compressed) format
actcal.DSS <- seqformat(actcal,13:24,
from="STS", to="DSS", compressed=TRUE)
head(actcal.DSS)
Run the code above in your browser using DataLab