Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-08 Thread Robert Baer
And I probably should have included this link: http://journal.r-project.org/archive/2014-1/loo.pdf On 8/8/2015 12:50 PM, Robert Baer wrote: On 8/6/2015 5:25 AM, Federico Calboli wrote: Hi All, let’s assume I have a vector of letters drawn only once from the alphabet: x = sample(letters, 1

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-08 Thread Robert Baer
On 8/6/2015 5:25 AM, Federico Calboli wrote: Hi All, let’s assume I have a vector of letters drawn only once from the alphabet: x = sample(letters, 15, replace = F) x [1] "z" "t" "g" "l" "u" "d" "w" "x" "a" "q" "k" "j" "f" "n" “v" y = x[c(1:7,9:8, 10:12, 14, 15, 13)] I would now like to t

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-07 Thread David Winsemius
On Aug 7, 2015, at 12:22 AM, Federico Calboli wrote: > >> On 7 Aug 2015, at 01:59, Bert Gunter wrote: >> >> Boris: >> >> You may be right, but it seems like esp to me based on the op's >> non-description of likelihood of coming from the same noisy process. My >> response would be: seek loca

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-07 Thread Federico Calboli
> On 7 Aug 2015, at 01:59, Bert Gunter wrote: > > Boris: > > You may be right, but it seems like esp to me based on the op's > non-description of likelihood of coming from the same noisy process. My > response would be: seek local statistical help, as your replies indicate a > good deal of s

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-06 Thread Bert Gunter
Boris: You may be right, but it seems like esp to me based on the op's non-description of likelihood of coming from the same noisy process. My response would be: seek local statistical help, as your replies indicate a good deal of statistical confusion. Cheers, Bert On Thursday, August 6, 2015

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-06 Thread Boris Steipe
You are looking for what is known as the "Cayley distance" between vectors - an edit distance that allows only transpositions. RSeek mentions PerMallows (https://cran.r-project.org/web/packages/PerMallows/PerMallows.pdf) and Rankluster (https://cran.r-project.org/web/packages/Rankcluster/Rankcl

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-06 Thread Federico Calboli
> On 6 Aug 2015, at 15:40, Bert Gunter wrote: > > Define "goodness of match" . For exact matches, see ?"==" , all.equal, etc. Fair point. I would define it as a number that tells me how likely it is that the same (noisy) process produced both lists. BW F > > Bert > > On Thursday, Aug

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-06 Thread Bert Gunter
Define "goodness of match" . For exact matches, see ?"==" , all.equal, etc. Bert On Thursday, August 6, 2015, Federico Calboli wrote: > Hi All, > > let’s assume I have a vector of letters drawn only once from the alphabet: > > x = sample(letters, 15, replace = F) > x > [1] "z" "t" "g" "l" "u"