ITPub博客

首页 > IT职业 > IT图书 > union(并),setdiff(差),intersect(交)R语言

union(并),setdiff(差),intersect(交)R语言

IT图书 作者:sprest 时间:2021-09-09 09:31:50 0 删除 编辑


元素(只取x中不同的元素)
setdiff(x, y)


setdiff(x=1:4, y=2:3)[1] 1 4



字符串向量的交集只有一个元素 "abc"

intersect(x=c("abc", "bcd"),

y = c("abc", 12, "Apple"))

[1] "abc"

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3088/viewspace-2804327/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-13

  • 博文量
    101
  • 访问量
    821