Created
January 23, 2019 14:30
-
-
Save stufield/1e2e9e01ea410b9ba28a907c17e116ef to your computer and use it in GitHub Desktop.
Functional Assignment Trick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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