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