Question

I have data in a notepad text file. Please help me to convert the TXT file into TSE format.

Text Data in notepad:

date, time, user, process, activity
2013-06-25, 10:34:21.4375, uni15, 1, Index
2013-06-25, 10:35:13.0156, uni15, 1, ItemDetailsPartial
2013-06-25, 10:35:54.9843, uni15, 1, CloseItemDetailsPartial
2013-06-25, 10:35:59.5781, uni15, 1, FilterByTag
2013-06-25, 10:36:05.9218, uni15, 1, ItemDetailsPartial

Was it helpful?

Solution

This answer draws on details of the data the OP gave in a mail to the TraMineR-mailinglist.

As already pointed out by Gilbert in the comment, you firstly have to import the text file using read.table() or read.csv().

To me, your data already seems to be in time stamped event sequences (TSE) format, so there is no need of conversion. Rather, the problem is that sequence analysis uses discrete time data and your data seems to be on a continous scale. Therefore, you secondly need to define a reasonable time scale for your own research question. Considering your data, I think that you do not need realtime data but that you could use process time in a less precise granularity (round up to seconds, for example).

After this redefinition, you can thirdly use the TSE_to_STS function of the package TraMineRextras to transform your dataframe into STS format. Then you can finally define a sequence object using TraMineR.

Please, consult also the chapter 4 and 5 of the TraMineR manual.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top