Skip to content

Instantly share code, notes, and snippets.

@iracooke
Created August 18, 2015 01:39
Show Gist options
  • Save iracooke/20f701e33bc0adf1dc39 to your computer and use it in GitHub Desktop.
Save iracooke/20f701e33bc0adf1dc39 to your computer and use it in GitHub Desktop.
R Cheat Sheet
setA = c("A","B","C","D")
setB = c("A","B","E","F")
# Everything in both sets
union(setA,setB)
# Only items present in setB
setdiff(setB,setA)
# Only items present in setA
setdiff(setA,setB)
# Items present in both sets
intersect(setA,setB)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment