Data Science Desktop Survival Guide
by Graham Williams |
|||||
Glue Pipelines |
weatherAUS %>%
sample_n(6) %>% glue_data("Observation", " {rownames(.) %>% as.integer() %>% comma() %>% sprintf('%7s', .)}", " location {Location %>% sprintf('%-14s', .)}", " max temp {MaxTemp %>% sprintf('%5.1f', .)}")
It can also be useful with the tidy verse work flow. |
weatherAUS %>%
sample_n(6) %>% mutate(TempRange = glue("{MinTemp}-{MaxTemp}")) %>% glue_data("Observed temperature range at {Location} of {TempRange}")
|