I have some vectors like
A1 = c(A,B,C)
A2 = c(A,B,C)
A3 = c(A,B,NA)
A4 = c(NA,B,C)
Now I want something which will give me results like :
Pattern (A,B,C) occurs 2 times.
Pattern (A,B) occurs 3 times.
Pattern (B,C) occurs 3 times.
For now I take each vector and compare them. By this way i can find A,B,C pattern but not A,B or B,C pattern.
Is there any package or some mathematical model which can do it?
EDIT1 : I will not be able to post the code due to some confidentiality issues but essentialy what I did was I compared first vector with second and then to third and so on using %in%. It gave me a matrix of true false. Then I repeated the process for all vectors. Lastly I found out where true have max density in the matrix.
Edit 2 : I know of a-priori algorithm and arules package but a-priori is not very efficient.