Skip to content

Commit

Permalink
Merge pull request #15 from mkierczak/master
Browse files Browse the repository at this point in the history
add slide on joins
  • Loading branch information
mkierczak authored Oct 22, 2024
2 parents fec95de + 0df6158 commit 0695795
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions slide_tidyverse.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,37 @@ bijou %>% head(n = 10) %>%
missing_stones %>% complete(cut, continent)
```

---
name: joins

# Joining Data with `_join`

```{r echo=FALSE, eval=TRUE}
# create two tibbles that share key column and can illustrate joins
tibble1 <- tibble(key = c(1, 2, 3, 4, 5), value1 = c('a', 'b', 'c', 'd', 'e'))
tibble2 <- tibble(key = c(1, 2, 3, 6, 7), value2 = c('A', 'B', 'C', 'F', 'G'))
```

.pull-left-50[
```{r echo=FALSE}
print(tibble1)
```
]

.pull-right-50[
```{r echo=FALSE}
print(tibble2)
```
]

**Example:**

```{r}
inner_join(tibble1, tibble2, by = 'key')
```

`[inner, left, right, full]_join` are available. Try these!

---
name: more_tidyverse

Expand Down

1 comment on commit 0695795

@nimarafati
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Please sign in to comment.