I have vector a = 10:15 and vector b = 13:17, So How can I create a function that tells me the number of equal values. The result is 3. (because the same values are 13,14,15). Thank you
foo <- function(x, y) length(intersect(x, y)) a <- 10:15 b <- 13:17 foo(a, b) # [1] 3
1.4m articles
1.4m replys
5 comments
57.0k users