We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we make this work?
100 %>% sample(10) %T>% browser() %>% sum()
The primary challenge is that the first argument to browser() is text.
browser()
text
The text was updated successfully, but these errors were encountered:
100 %>% sample(10) %T>% { browser() } %>% sum()
more useful in the proposal branch though.
Sorry, something went wrong.
I know we want to minimise aliases, but maybe this would be useful enough to qualify for inclusion:
pipe_browser <- function(x, condition = NULL) { if (is.null(condition) || isTRUE(condition) { browser() } invisible(x) }
(Edited to support conditional browsing)
Ooops, except that we need to evaluate browser() in the caller_env()
caller_env()
library(rlang) pipe_browser <- function(x, condition = NULL) { if (is.null(condition) || isTRUE(condition)) { eval_bare(expr(browser(skipCalls = 1L)), env = caller_env()) } invisible(x) } # Check that it works f <- function(x) { y <- 10 pipe_browser(y) } f(1)
No branches or pull requests
Can we make this work?
The primary challenge is that the first argument to
browser()
istext
.The text was updated successfully, but these errors were encountered: