Skip to content

Instantly share code, notes, and snippets.

@emitanaka
Last active May 1, 2019 11:23
Show Gist options
  • Save emitanaka/1c58351da6fc67712fc8a1a61795536a to your computer and use it in GitHub Desktop.
Save emitanaka/1c58351da6fc67712fc8a1a61795536a to your computer and use it in GitHub Desktop.
Hadley in Sydney Public Lecture
# the power of piping + functional programming + stringr + some gluing <3
library(tidyverse)
tidyverse <- "Hadley"
"You're" -> Hadley
"super" -> Thanks
"{tidyverse} is awesome" %>%
str_glue() %>%
print() %>%
str_replace("is awesome", "Thanks ") %>%
word(2:1) %>%
str_flatten(" ") %>%
print() %>%
word(2:1) %>%
map(~paste0("{", .x, "}")) %>%
str_flatten(" ") %>%
str_glue()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment