TSE_to_STS | R Documentation |
Conversion from TSE (time stamped event sequences) vertical format into STS (state sequences) data format.
TSE_to_STS(seqdata, id = 1, timestamp = 2, event = 3, stm = NULL, tmin = 1,
tmax = NULL, firstState = "None")
seqdata |
a data frame or matrix with event sequence data in TSE format. |
id |
Name or index of the column containing the id's of the sequences. |
timestamp |
Name or index of the column containing the timestamps of the events. |
event |
Name or index of the column containing the events. |
stm |
An event to state transition matrix (See |
tmin |
Integer. Starting time of the state sequence. |
tmax |
Integer. Ending time of the state sequence. |
firstState |
Character. The name of the state before any events has occurred. |
Convert TSE (time stamped event sequences) data into STS (state sequences) format. By default, the states are defined has the combination of events that already occurred.
Different schemes may be specified using function seqe2stm
and the stm
argument.
A data.frame
with the sequences in STS format.
This function is a pre-release and further testing is still needed, please report any problems.
Matthias Studer
Ritschard, G., Gabadinho, A., Studer, M. & Müller, N.S. (2009), "Converting between various sequence representations", In Ras, Z. & Dardzinska, A. (eds) Advances in Data Management. Series: Studies in Computational Intelligence. Volume 223, pp. 155-175. Berlin: Springer.
See Also seqe2stm
, seqformat
.
data(actcal.tse)
events <- c("PartTime", "NoActivity", "FullTime", "LowPartTime")
## Dropping all previous events.
stm <- seqe2stm(events, dropList=list(PartTime=events[-1],
NoActivity=events[-2], FullTime=events[-3], LowPartTime=events[-4]))
mysts <- TSE_to_STS(actcal.tse[1:100,], id=1, timestamp=2, event=3,
stm=stm, tmin=1, tmax=12, firstState="None")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.