作者:手机用户2502937013 | 来源:互联网 | 2023-09-18 11:16
篇首语:本文由编程笔记#小编为大家整理,主要介绍了r检查列表中的项目来自http://stackoverflow.com/questions/3485456/useful-little-fun
篇首语:本文由编程笔记#小编为大家整理,主要介绍了r 检查列表中的项目来自http://stackoverflow.com/questions/3485456/useful-little-functions-in-r #r相关的知识,希望对你有一定的参考价值。
setdiff2 <- function(x,y) {
#returns a list of the elements of x that are not in y
#and the elements of y that are not in x (not the same thing...)
Xdiff = setdiff(x,y)
Ydiff = setdiff(y,x)
list(X_not_in_Y=Xdiff, Y_not_in_X=Ydiff)
}