Set operations for data frames
Wrappers of set operations in data.table. Only difference is it could be applied to non-data.table data frames by recognizing and coercing them to data.table automatically.
intersect_dt(x, y, all = FALSE) union_dt(x, y, all = FALSE) setdiff_dt(x, y, all = FALSE) setequal_dt(x, y, all = TRUE)
x |
A data.frame |
y |
A data.frame |
all |
Logical. When |
A data.table
x = iris[c(2,3,3,4),] x2 = iris[2:4,] y = iris[c(3:5),] intersect_dt(x, y) # intersect intersect_dt(x, y, all=TRUE) # intersect all setdiff_dt(x, y) # except setdiff_dt(x, y, all=TRUE) # except all union_dt(x, y) # union union_dt(x, y, all=TRUE) # union all setequal_dt(x, x2, all=FALSE) # setequal setequal_dt(x, x2) # setequal all
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.