Created
March 27, 2020 21:02
-
-
Save tylerlittlefield/72b79c14b85edc47a2014b5cd89cd4a0 to your computer and use it in GitHub Desktop.
Compare sets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compare <- function(x, y) { | |
list( | |
"These values are in X but not Y" = setdiff(x, y), | |
"These values are in Y but not X" = setdiff(y, x), | |
"These values are shared between X and Y" = intersect(x, y), | |
"Combined, X and Y returns these values" = union(x, y) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment