Reputation: 93
Say you have the following two arrays:
Array1 = c(1, 2, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 19)
Array2 = c(1, 3, 5, 9, 11, 14, 18)
Now say you want to make a new array which only holds the values that are the same between Array1 and Array2:
NewArray = c(1, 9, 11, 14, 18)
How does one do this without having to manually scan each Array1 and Array2 to construct NewArray?
Upvotes: 0
Views: 24