I have two vectors of different size having different values.
v1=c("3423","3221","65892","8033")
v2=c("3423","3221","9923")
According to these two vectors, I have following set of values.
{"3423","3221","65892","8033","9923"}
Now I want to calculate cosine similarity between these two vectors. I don't know how to make binary vectors like following.
v1bin=c(1,1,1,1,0)
v2bin=c(1,1,0,0,1)
these vectors are useful for computing cosine similarity. Is there any way to make such binary vectors?