Skip to content

Instantly share code, notes, and snippets.

@tylerlittlefield
Created March 27, 2020 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylerlittlefield/72b79c14b85edc47a2014b5cd89cd4a0 to your computer and use it in GitHub Desktop.
Save tylerlittlefield/72b79c14b85edc47a2014b5cd89cd4a0 to your computer and use it in GitHub Desktop.
Compare sets
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