📌  相关文章
📜  r 查找向量之间的共同元素 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:52:00.003000             🧑  作者: Mango

代码示例1
# Basic syntax:
intersect(vector_1, vector_2) # For two vectors
Reduce(intersect, list(vector_1, vector_2, vector_3)) # For multiple vectors

# Example usage:
vector_1 = c(1,2,3,4,5)
vector_1 = c(2,4,6,8)
intersect(vector_1, vector_2)
--> 2 4

# Note, the vectors don't have to have the same length