Last active
May 22, 2019 18:13
-
-
Save gadenbuie/64f3f563fd4affab14de1958735b6e61 to your computer and use it in GitHub Desktop.
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
library(rlang) | |
enexpr_first <- function(x, aggr_func) { | |
browser() | |
func <- enexpr(aggr_func) | |
x <- aggr_func(x) | |
list(x = x, f = func) | |
} | |
enexpr_second <- function(x, aggr_func) { | |
browser() | |
x <- aggr_func(x) | |
func <- enexpr(aggr_func) | |
list(x = x, f = func) | |
} |
Thanks @Chris-Engelhardt, I didn't know about f
being a browser()
mode keyword (cool TIL!)
I didn't either, @gadenbuie, until I tried stepping through your function in browser()
mode. Thanks also for teaching me about purrr::partial()
!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you think it makes sense to update the
f
objects (lines 7, 8, 14, and 15) with something other thanf
? If usingbrowser()
mode, inspecting thef
object terminates the browsing session.