Created
July 16, 2015 08:55
-
-
Save safferli/164f1ed49d32e1081459 to your computer and use it in GitHub Desktop.
remove all instances in first table that exist in second table
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
library(data.table) | |
library(dplyr) | |
a <- data.table(x = c("A", "B", "C", "D"), | |
y = c(1, 2, 3, 4), | |
z = c("good", "bad", "bad", "good")) %>% | |
setkey(x, y) | |
b <- data.table(x = c("B", "C"), | |
y = c(2, 3)) %>% | |
setkey(x, y) | |
c <- a[!b] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment