filter_joins {poorman} | R Documentation |
Filtering joins filter rows from x
based on the presence or absence of
matches in y
:
Description
-
semi_join()
return all rows fromx
with a match iny
. -
anti_join()
return all rows fromx
without a match iny
.
Usage
anti_join(x, y, by = NULL)
semi_join(x, y, by = NULL)
Arguments
x , y |
The |
by |
A character vector of variables to join by. If |
Examples
table1 <- data.frame(
pupil = rep(1:3, each = 2),
test = rep(c("A", "B"), 3),
score = c(60, 70, 65, 80, 85, 70),
stringsAsFactors = FALSE
)
table2 <- table1[c(1, 3, 4), ]
table1 %>% anti_join(table2, by = c("pupil", "test"))
table1 %>% semi_join(table2, by = c("pupil", "test"))
[Package poorman version 0.2.7 Index]