From 8fee078c9db7956d3e3444bbda68655efb4153fb Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 20 Jun 2018 11:00:39 +0200 Subject: [PATCH] Better naming consistency (#621) Now 'key' is used commonly across step-by-step guide, final complex pipe, and the exercise. --- tidy.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tidy.Rmd b/tidy.Rmd index 8a079e8..a7aa088 100644 --- a/tidy.Rmd +++ b/tidy.Rmd @@ -526,9 +526,9 @@ I've shown you the code a piece at a time, assigning each interim result to a ne ```{r, results = "hide"} who %>% - gather(code, value, new_sp_m014:newrel_f65, na.rm = TRUE) %>% - mutate(code = stringr::str_replace(code, "newrel", "new_rel")) %>% - separate(code, c("new", "var", "sexage")) %>% + gather(key, value, new_sp_m014:newrel_f65, na.rm = TRUE) %>% + mutate(key = stringr::str_replace(key, "newrel", "new_rel")) %>% + separate(key, c("new", "var", "sexage")) %>% select(-new, -iso2, -iso3) %>% separate(sexage, c("sex", "age"), sep = 1) ```