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.
给定一个可以有重复元素的数组,我想从这个数组派生两种类型的信息:
1)是否有任何函数可以返回没有任何重复元素的派生数组?
2)是否有任何功能可以列出那些重复的元素?
A
dups <- duplicated(as.vector(A)) dim(dups) <- dim(A)
dups
# take a copy ArrayWithNoDups <- A ArrayWithNoDups[dups] <- NA ArrayWithNoDups