From 0d7ba63f77c217d8bf79b8f6089894031dbf6242 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 20 Jun 2018 11:00:07 +0200 Subject: [PATCH] Use pipe for the spread example (#620) To keep consistency with the rest of chapter. --- tidy.Rmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tidy.Rmd b/tidy.Rmd index da83167..8a079e8 100644 --- a/tidy.Rmd +++ b/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"}