setcompare | R Documentation |
This is an wrapper around setdiff
and intersect
to quickly compare to sets.
setcompare(x, y)
## Default S3 method:
setcompare(x, y)
## S3 method for class 'data.frame'
setcompare(x, y)
x, y |
sets to compare. Implemented methods support atomic vectors and data frames, see Details |
The default method expects atomic vectors.
The method for data frames compares the sets of variable names.
A list with three components
Elements of
x
not fount in y
Elements present in both x
and y
Elements in y
not found in x
setdiff
, intersect
# default method for vectors
x <- 1:5
y <- 3:7
setcompare(x, y)
setcompare(letters[x], letters[y])
# method for data frames
d1 <- structure(as.data.frame(matrix(rnorm(25), 5, 5)), names=letters[x])
d2 <- structure(as.data.frame(matrix(rnorm(25), 5, 5)), names=letters[y])
setcompare(d1, d2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.