Better naming consistency (#621)

Now 'key' is used commonly across step-by-step guide, final complex pipe, and the exercise.
This commit is contained in:
Hao Chen 2018-06-20 11:00:39 +02:00 committed by Hadley Wickham
parent 0d7ba63f77
commit 8fee078c9d
1 changed files with 3 additions and 3 deletions

View File

@ -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)
```