Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
B和C。
A <- 1:5 B <- 3:7 C <- 6:10
现在我想合并这三个向量。我正在这样做:
uni <- union (A,union(B,C))
但是如果有三个以上的向量我需要合并 ??
将它们组合成 alist然后使用Reduce:
list
Reduce
Reduce(union, list(A, B, C)) [1] 1 2 3 4 5 6 7 8 9 10