3
Suppose I have a vector that goes from 1 to 10. I want to check binary for each element of the vector if it is present in the matrix line, being 0 for no presence and 1 for presence, regardless of the element repeat I would only count 1 for it.
For example, in the first row of the matrix I have a[1,]= c(1,5,2,2,1)
. Thus, I would have 0 for the elements 3,4,6,7,8,9,10 and 1 for the elements 1,2,5.