setops: Set operations

Description Usage Arguments Examples

Description

These functions override the set functions provided in base to make them generic so that efficient versions for data frames and other tables can be provided. The default methods call the base versions.

Usage

1
2
3
4
5
6
7
8
9
intersect(x, y, ...)

union(x, y, ...)

union_all(x, y, ...)

setdiff(x, y, ...)

setequal(x, y, ...)

Arguments

x, y

objects to perform set function on (ignoring order)

...

other arguments passed on to methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mtcars$model <- rownames(mtcars)
first <- mtcars[1:20, ]
second <- mtcars[10:32, ]

intersect(first, second)
union(first, second)
setdiff(first, second)
setdiff(second, first)

union_all(first, second)
setequal(mtcars, mtcars[32:1, ])

YTLogos/dplyr documentation built on May 20, 2019, 1:44 p.m.