Selaa lähdekoodia

Add text from ?dplyr::join

pull/5/merge
Garrick Aden-Buie 7 vuotta sitten
vanhempi
commit
1f313fff4d
2 muutettua tiedostoa jossa 39 lisäystä ja 4 poistoa
  1. +16
    -2
      README.Rmd
  2. +23
    -2
      README.md

+ 16
- 2
README.Rmd Näytä tiedosto



[![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/gadenbuie/tidy-animated-verbs/master?urlpath=rstudio) [![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/gadenbuie/tidy-animated-verbs/master?urlpath=rstudio)


- Mutate Joins: [`inner_join()`](#inner-join), [`left_join()`](#left-join),
- Mutating Joins: [`inner_join()`](#inner-join), [`left_join()`](#left-join),
[`right_join()`](#right-join), [`full_join()`](#full-join) [`right_join()`](#right-join), [`full_join()`](#full-join)
- Filtering Joins: [`semi_join()`](#semi-join), [`anti_join()`](#anti-join) - Filtering Joins: [`semi_join()`](#semi-join), [`anti_join()`](#anti-join)
- [Relational Data](#relational-data) - [Relational Data](#relational-data)
- [gganimate](#gganimate) - [gganimate](#gganimate)


## Mutate Joins
## Mutating Joins


```{r intial-dfs} ```{r intial-dfs}
source("R/00_base.R") source("R/00_base.R")


### Inner Join ### Inner Join


> All rows from `x` where there are matching values in `y`, and all columns from `x` and `y`.

```{r inner-join} ```{r inner-join}
source("R/inner_join.R") source("R/inner_join.R")
``` ```


### Left Join ### Left Join


> All rows from `x`, and all columns from `x` and `y`. Rows in `x` with no match in `y` will have `NA` values in the new columns.

```{r left-join} ```{r left-join}
source("R/left_join.R") source("R/left_join.R")
``` ```


### Left Join (Extra Rows in y) ### Left Join (Extra Rows in y)


> ... If there are multiple matches between `x` and `y`, all combinations of the matches are returned.

```{r left-join-extra} ```{r left-join-extra}
source("R/left_join_extra.R") source("R/left_join_extra.R")
``` ```


### Right Join ### Right Join


> All rows from y, and all columns from `x` and `y`. Rows in `y` with no match in `x` will have `NA` values in the new columns.

```{r right-join} ```{r right-join}
source("R/right_join.R") source("R/right_join.R")
``` ```


### Full Join ### Full Join


> All rows and all columns from both `x` and `y`. Where there are not matching values, returns `NA` for the one missing.

```{r full-join} ```{r full-join}
source("R/full_join.R") source("R/full_join.R")
``` ```


### Semi Join ### Semi Join


> All rows from `x` where there are matching values in `y`, keeping just columns from `x`.

```{r semi-join} ```{r semi-join}
source("R/semi_join.R") source("R/semi_join.R")
``` ```


### Anti Join ### Anti Join


> All rows from `x` where there are not matching values in `y`, keeping just columns from `x`.

```{r anti-join} ```{r anti-join}
source("R/anti_join.R") source("R/anti_join.R")
``` ```

+ 23
- 2
README.md Näytä tiedosto



[![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/gadenbuie/tidy-animated-verbs/master?urlpath=rstudio) [![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/gadenbuie/tidy-animated-verbs/master?urlpath=rstudio)


- Mutate Joins: [`inner_join()`](#inner-join),
- Mutating Joins: [`inner_join()`](#inner-join),
[`left_join()`](#left-join), [`right_join()`](#right-join), [`left_join()`](#left-join), [`right_join()`](#right-join),
[`full_join()`](#full-join) [`full_join()`](#full-join)


- [Relational Data](#relational-data) - [Relational Data](#relational-data)
- [gganimate](#gganimate) - [gganimate](#gganimate)


## Mutate Joins
## Mutating Joins


<img src="images/original-dfs.png" width="480px" /> <img src="images/original-dfs.png" width="480px" />




### Inner Join ### Inner Join


> All rows from `x` where there are matching values in `y`, and all
> columns from `x` and `y`.

![](images/inner-join.gif) ![](images/inner-join.gif)


``` r ``` r


### Left Join ### Left Join


> All rows from `x`, and all columns from `x` and `y`. Rows in `x` with
> no match in `y` will have `NA` values in the new columns.

![](images/left-join.gif) ![](images/left-join.gif)


``` r ``` r


### Left Join (Extra Rows in y) ### Left Join (Extra Rows in y)


> … If there are multiple matches between `x` and `y`, all combinations
> of the matches are returned.

![](images/left-join-extra.gif) ![](images/left-join-extra.gif)


``` r ``` r


### Right Join ### Right Join


> All rows from y, and all columns from `x` and `y`. Rows in `y` with no
> match in `x` will have `NA` values in the new columns.

![](images/right-join.gif) ![](images/right-join.gif)


``` r ``` r


### Full Join ### Full Join


> All rows and all columns from both `x` and `y`. Where there are not
> matching values, returns `NA` for the one missing.

![](images/full-join.gif) ![](images/full-join.gif)


``` r ``` r


### Semi Join ### Semi Join


> All rows from `x` where there are matching values in `y`, keeping just
> columns from `x`.

![](images/semi-join.gif) ![](images/semi-join.gif)


``` r ``` r


### Anti Join ### Anti Join


> All rows from `x` where there are not matching values in `y`, keeping
> just columns from `x`.

![](images/anti-join.gif) ![](images/anti-join.gif)


``` r ``` r

Loading…
Peruuta
Tallenna