Use pipe for the spread example (#620)
To keep consistency with the rest of chapter.
This commit is contained in:
parent
877d165d4d
commit
0d7ba63f77
3
tidy.Rmd
3
tidy.Rmd
|
@ -190,7 +190,8 @@ To tidy this up, we first analyse the representation in similar way to `gather()
|
|||
Once we've figured that out, we can use `spread()`, as shown programmatically below, and visually in Figure \@ref(fig:tidy-spread).
|
||||
|
||||
```{r}
|
||||
spread(table2, key = type, value = count)
|
||||
table2 %>%
|
||||
spread(key = type, value = count)
|
||||
```
|
||||
|
||||
```{r tidy-spread, echo = FALSE, out.width = "100%", fig.cap = "Spreading `table2` makes it tidy"}
|
||||
|
|
Loading…
Reference in New Issue