[Traminer-users] Format of sequences

Simon PAYE simon.paye at sciencespo.fr
Thu Jun 11 09:46:20 CEST 2015


Hi there,
Anton, I just used the HSPELL_to_STS function and it worked well.
I suggest you to try something like this:

seq_sts <- HSPELL_to_STS(data,
    begin=c("BEGIN1","BEGIN2",...),
    end=c("END1","END2",...),
    status=c("STATE1","STATE2",...))

Best,
Simon

2015-06-11 8:53 GMT+02:00 thomas collas <thomas.collas at gmail.com>:

> Hello,
> That's the same proposition actually.
> tc
>
> 2015-06-11 8:45 GMT+02:00 Hadrien Commenges <hc at parisgeo.cnrs.fr>:
>
>> 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.
>>
>> Another option would be the melt() function in the reshape2 package.
>>
>> ------------------------------
>> *De: *"thomas collas" <thomas.collas at gmail.com>
>> *À: *"Users questions" <traminer-users at lists.r-forge.r-project.org>
>> *Envoyé: *Mercredi 10 Juin 2015 21:03:05
>> *Objet: *Re: [Traminer-users] Format of sequences
>>
>>
>> Addendum : Do not forget to keep the ID column with the three other
>> columns at each iteration.
>>
>> 2015-06-10 21:01 GMT+02:00 thomas collas <thomas.collas at gmail.com>:
>>
>>> Hello Anton,
>>> 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.
>>> I hope that helps,
>>> thomas collas
>>>
>>> 2015-06-10 18:51 GMT+02:00 Anton Perdoncin <anton.perdoncin at gmail.com>:
>>>
>>>> Hi,
>>>>
>>>> I have sequences in the following format :
>>>>
>>>> ID    BEGIN1        END1            STATE1        BEGIN2        END2
>>>>    STATE2  etc... until 18
>>>> 1   01/01/1950  01/01/1960          X         02/01/1960   30/01/1960
>>>>    Y    ...
>>>> 2   01/01/1950  01/01/1960          X         02/01/1960   30/01/1960
>>>>    Y    ...
>>>>
>>>> One line = one individual. Successive episodes = successive columns.
>>>>
>>>> I know that I need to convert dates into numbers: no problem with that.
>>>>
>>>> However, does anyone have any idea on how I could convert such a df into
>>>> an STS or SPELL format ?
>>>>
>>>> Thanks!
>>>>
>>>> Best regards,
>>>>
>>>> Anton Perdoncin
>>>> _______________________________________________
>>>> Traminer-users mailing list
>>>> Traminer-users at lists.r-forge.r-project.org
>>>>
>>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>>>>
>>>
>>>
>>
>> _______________________________________________
>> Traminer-users mailing list
>> Traminer-users at lists.r-forge.r-project.org
>>
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>>
>>
>> _______________________________________________
>> Traminer-users mailing list
>> Traminer-users at lists.r-forge.r-project.org
>>
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>>
>
>
> _______________________________________________
> Traminer-users mailing list
> Traminer-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>

-- 
--------------------------------------------------------------------------
Tous les courriers électroniques émis depuis la messagerie de Sciences Po 
doivent respecter les conditions d'usage.
Pour les consulter rendez-vous sur :
http://www.sciencespo.fr/ressources-numeriques/fr/content/regles-de-confidentialite
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20150611/2734c966/attachment-0001.html>


More information about the Traminer-users mailing list