2

I've created a state sequence using the code:

comp.seq <- seqdef(comp,NULL,states=comp.scodes,labels=comp.labels, alphabet=comp.alphabet,right="Z",left="Z")

then i created a event sequence from that using:

comp.seqe<-seqecreate(comp.seq,tevent="state", use.labels=FALSE)

Then I searched for subsequences using:

subs <- seqefsub(comp.seqe,strsubseq=c("(A)-(C)-(A)"))

Now all I wanna do is create some plots of the resulting sequences. But I found out that there are no plotting functions like seqplot for event sequences, thus I'd like to convert the resulting event sequences into state sequences. Is it possible ? I've tried seqdef() with the subs object but wasn't successful. Is it the appropriate function?

Thanks

Pedro Braz
  • 2,261
  • 3
  • 25
  • 48

1 Answers1

2

Look at this answer for how to convert event sequences in time stamped event (TSE) format to state sequences. And here you will find a solution for putting the outcome of seqefsub into TSE form.

Note that plots for state sequences may not be suited for rendering the outcome of seqefsub. The returned subsequences have no time stamp, which will result in an state alignment without sound meaning. Why not simply using plot(subs), or the seqpcplot function if you are interested in the order of the events. seqpcplot accepts directly event sequences objects as input, and the outcome of seqefsub is such an object.

Community
  • 1
  • 1
Gilbert
  • 3,570
  • 18
  • 28
  • I would actually see something to infer common characteristics of those sequences. I have other dimensions in those so i'd like to see other dimension's states frequency in order to determine if there is any common link. This function only plots the sequence, which I kinda know since I've looked for the pattern I wanted. thanks ! – Pedro Braz May 22 '15 at 17:23