More about join diagrams

This commit is contained in:
hadley 2016-01-14 09:51:33 -06:00
parent 32fc676b01
commit 9f758c5e27
1 changed files with 7 additions and 0 deletions

View File

@ -163,6 +163,13 @@ knitr::include_graphics("diagrams/join-setup2.png")
(If you look closely, you might notice that we've switched the order of the keys and values in `x`. This is to emphasise that joins match based on the key variable; value variable is just carried along for the ride.)
In an actual join, matches will be indicated with dots. The colour of the dots match the colour of the keys to remind that that's what important. Then the number of dots = the number of matches = the number of rows in the output.
```{r, echo = FALSE, out.width = "70%"}
knitr::include_graphics("diagrams/join-inner.png")
```
### Inner join {#inner-join}
The simplest type of join is the __inner join__. An inner join matches pairs of observations whenever their keys are equal: