Skip to content

Instantly share code, notes, and snippets.

@stufield
Created January 23, 2019 14:30
Show Gist options
  • Save stufield/1e2e9e01ea410b9ba28a907c17e116ef to your computer and use it in GitHub Desktop.
Save stufield/1e2e9e01ea410b9ba28a907c17e116ef to your computer and use it in GitHub Desktop.
Functional Assignment Trick
# Check this out; NSE functional assignment
# Works for functions that take a single `x` argument
# and linear pipe only downstream
myfun <- . %>%
sqrt() %>%
as.character() %>%
paste("is the coolest number ever!")
myfun(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment