parent
7c9c28c363
commit
8bc81d71b1
|
@ -16,7 +16,7 @@ To work with relational data you need verbs that work with pairs of tables. Ther
|
|||
|
||||
* __Set operations__, which treat observations as if they were set elements.
|
||||
|
||||
The most common place to find relational data is in a _relational_ database management system (or RDBMS), a term that encompasses almost all modern databases. If you've used a database before, you've almost certainly used SQL. If so, you should find the concepts in this chapter familiar, although their expression in dplyr is a little different. Generally, dplyr is a little easier to use than SQL because dplyr is specialised to data analysis: it makes common data analysis operations easier, at the expense of making it more difficult to do other things that don't commonly need for data analysis.
|
||||
The most common place to find relational data is in a _relational_ database management system (or RDBMS), a term that encompasses almost all modern databases. If you've used a database before, you've almost certainly used SQL. If so, you should find the concepts in this chapter familiar, although their expression in dplyr is a little different. Generally, dplyr is a little easier to use than SQL because dplyr is specialised to do data analysis: it makes common data analysis operations easier, at the expense of making it more difficult to do other things that don't commonly need for data analysis.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
|
@ -176,7 +176,7 @@ flights2 <- flights %>%
|
|||
flights2
|
||||
```
|
||||
|
||||
(Remember, when you're in RStudio, you can also use `View()` to avoid this problem).
|
||||
(Remember, when you're in RStudio, you can also use `View()` to avoid this problem.)
|
||||
|
||||
Imagine you want to add the full airline name to the `flights2` data. You can combine the `airlines` and `flights2` data frames with `left_join()`:
|
||||
|
||||
|
@ -186,7 +186,7 @@ flights2 %>%
|
|||
left_join(airlines, by = "carrier")
|
||||
```
|
||||
|
||||
The result of joining airlines to flights is an additional variable: `name`. This is why I call this type of join a mutating join. In this case, you could have got to the same place using `mutate()` and R's base subsetting:
|
||||
The result of joining airlines to flights2 is an additional variable: `name`. This is why I call this type of join a mutating join. In this case, you could have got to the same place using `mutate()` and R's base subsetting:
|
||||
|
||||
```{r}
|
||||
flights2 %>%
|
||||
|
|
Loading…
Reference in New Issue