FCE_to_TSE | R Documentation |
Data conversion from Fixed Column Event format to TSE.
FCE_to_TSE(seqdata, id = NULL, cols, eventlist = NULL, firstEvent = NULL)
seqdata |
data frame or matrix containing event sequence data in FCE format. |
id |
column containing the identification numbers for the sequences. |
cols |
Real. Column containing the timing of the event. A missing value is interpreted as a non-occurrence of the event. |
eventlist |
Event names, specified in the same order as |
firstEvent |
Character. The name of an event to be added at the beginning of each event sequences. This allows to include individuals with no events. If |
The usual data format for event sequence is TSE (see seqecreate
).
A data.frame
with three columns: "id", "timestamp" and "event".
This function is a pre-release and further testing is still needed, please report any problems.
Matthias Studer
seqecreate
, seqformat
## Generate a ramdom data set
fce <- data.frame(id=1:100, event1=runif(100), event2=runif(100))
## Add missing values (ie non-occurrences)
fce[runif(100)<0.1, "event1"] <- NA
fce[runif(100)<0.1, "event2"] <- NA
tse <- FCE_to_TSE(fce, id="id", cols=c("event1", "event2"),
eventlist=c("Marriage", "Child birth"), firstEvent="Birth")
seq <- seqecreate(tse)
print(seq[1:10])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.