[Traminer-users] Re : Re: longest common substring

Matthias Studer Matthias.Studer at unige.ch
Mon Mar 19 16:56:44 CET 2012


Dear Hadrien,

Actually, there is no function to compute the longest common substring 
in TraMineR and, unfortunately, there is no easy way to modify the 
seqdist function (which relies on C code for performance reason). A 
custom function is thus needed. If you find a solution, please post it 
to this list, as it may interest other (or future) users.

All the best,
Matthias


Le 19.03.2012 16:30, Hadrien Commenges a écrit :
> Thank you Chris. I checked the TraMineR Extras package, but there is 
> no function to compute the longest common substring. I don't know if 
> the developers could give me an easy way to modify the seqdist 
> function in order to compute longest common substring. If not, I'm 
> very interested in the ideas you mentioned to do that, although I'm 
> not a good programmer and I don't know anything about C.
> Thanks,
> Hadrien
>
>
>
> ----- Mail d'origine -----
> De: Chris Cameron <cjc73 at cornell.edu>
> À: Users questions <traminer-users at r-forge.wu-wien.ac.at>
> Envoyé: Sun, 18 Mar 2012 18:48:56 +0100 (CET)
> Objet: Re: [Traminer-users] longest common substring
>
> Hi Hadrien -
>
> I don't see a documented way to compute the greatest common 
> substrings, so a custom function is probably necessary. (Maybe a dev 
> can tell you if there is a hidden flag to indicate substring vs 
> subsequence. The LCS code is implemented in C, so there is not an easy 
> function to modify in the TraMineR package. I have some ideas about 
> how you can make a custom function to do this if you want to talk 
> about it. Before you go that route, it would be worth checking the 
> "TraMineR Extras" package Matthias mentioned on the 16th.
>
> Good Luck
> Chris
>
>
>
>
> On Mar 17, 2012, at 3:02 PM, Hadrien Commenges wrote:
>
>     Hi,
>
>     I've a new question. I'd like to get a dissimilarity matrix based
>     on the longest common substring. The longest prefix (computed with
>     seqdist, method=LCS) doesn't work for me because I'd like to
>     compare substrings anywhere in the sequence. And the notion of
>     subsequence (computed with seqdist, method=LCS) doesn't serve my
>     purpose neither. I'd like to compute something like the LCS method
>     but with the stricter notion of substring. Is it possible?
>
>     Thanks,
>
>     Hadrien
>     _______________________________________________
>     Traminer-users mailing list
>     Traminer-users at lists.r-forge.r-project.org
>     <mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120319/40f8ef1c/attachment.html>


More information about the Traminer-users mailing list