<html><body><div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000"><div>You could also split your table by set of columns (columns 1:4, then col c(1, 5:7), etc.) and then rbind() all the tables.<br></div><div><br></div><div>Another option would be the melt() function in the reshape2 package.<br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>"thomas collas" <thomas.collas@gmail.com><br><b>À: </b>"Users questions" <traminer-users@lists.r-forge.r-project.org><br><b>Envoyé: </b>Mercredi 10 Juin 2015 21:03:05<br><b>Objet: </b>Re: [Traminer-users] Format of sequences<br><div><br></div><div dir="ltr">Addendum : Do not forget to keep the ID column with the three other columns at each iteration.</div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-10 21:01 GMT+02:00 thomas collas <span dir="ltr"><<a href="mailto:thomas.collas@gmail.com" target="_blank" data-mce-href="mailto:thomas.collas@gmail.com">thomas.collas@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div dir="ltr">Hello Anton,<div>An easy solution is to build a very short loop (I know R is not made for loops but it's only 18 iterations) separating each group of three columns, turning the headings into common ones (begin/end/state) and pasting each one below the other.</div><div>I hope that helps,</div><div>thomas collas</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-06-10 18:51 GMT+02:00 Anton Perdoncin <span dir="ltr"><<a href="mailto:anton.perdoncin@gmail.com" target="_blank" data-mce-href="mailto:anton.perdoncin@gmail.com">anton.perdoncin@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">Hi,<br> <br> I have sequences in the following format :<br> <br> ID BEGIN1 END1 STATE1 BEGIN2 END2<br> STATE2 etc... until 18<br> 1 01/01/1950 01/01/1960 X 02/01/1960 30/01/1960<br> Y ...<br> 2 01/01/1950 01/01/1960 X 02/01/1960 30/01/1960<br> Y ...<br> <br> One line = one individual. Successive episodes = successive columns.<br> <br> I know that I need to convert dates into numbers: no problem with that.<br> <br> However, does anyone have any idea on how I could convert such a df into<br> an STS or SPELL format ?<br> <br> Thanks!<br> <br> Best regards,<br> <br> Anton Perdoncin<br> _______________________________________________<br> Traminer-users mailing list<br> <a href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank" data-mce-href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users" target="_blank" data-mce-href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><br></blockquote></div><br></div></div></div></blockquote></div><br></div><br>_______________________________________________<br>Traminer-users mailing list<br>Traminer-users@lists.r-forge.r-project.org<br>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</div><div><br></div></div></body></html>