I have two vectors
v1<-c("T","A","G","R","A","G")
v2<-c("R","A","G,"T","A","G")
i want to find the longest matching subsequence. what i did is
v<-match(v1,v2)
v [1] 4 2 3 1 2 3
expected output:
v [1] NA 2 3 NA 2 3
the longest should be 2 3 in either location corresponding to the "A" "G" but the match function labels the "T" in v2 as 1 in the match, so the longest match subsequence end up being 1 2 3 and thats not what i want
any help please ? is there a way to let match function have like a minimum match before it starts labeling