# For interactive usage, auto_browse() is useful because it automatically
# starts a browser() in the right place.
f <- function(x) {
y <- 20
if (x > 5) {
stop("!")
} else {
x
}
}
if (interactive()) {
map(1:6, auto_browse(f))
}
Run the code above in your browser using DataLab