Use pipe for the spread example (#620)

To keep consistency with the rest of chapter.
This commit is contained in:
Hao Chen
2018-06-20 11:00:07 +02:00
committed by Hadley Wickham
parent 877d165d4d
commit 0d7ba63f77

View File

@@ -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"}