dplyr (version 0.2)

setops-data.frame: Set operations for data frames.

Description

These set operations are implemented with an efficeint C++ backend.

Usage

# S3 method for data.frame
intersect(x, y, ...)

# S3 method for data.frame union(x, y, ...)

# S3 method for data.frame setdiff(x, y, ...)

# S3 method for data.frame setequal(x, y, ...)

Arguments

x,y
Two data frames to compare, igoring order of row and columns
...
Needed for compatibility with generic. Otherwise ignored.

Examples

Run this code
mtcars$model <- rownames(mtcars)
first <- mtcars[1:20, ]
second <- mtcars[10:32, ]

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

setequal(mtcars, mtcars[32:1, ])

Run the code above in your browser using DataCamp Workspace