The future package is great, but when debuging with future::plan(sequential), any print doesn't get printed to console.
I think there is an option to enable printing to console.
Hope posting will make it more googlable in the future.
(Author of future here:) In future (>= 1.20.1) [2020-11-03], the official recommended solution is to use:
plan(sequential, split = TRUE)
This works with browser() and friends.
The answer by xiaodai is the best and most robust. I log a separate workaround here that might be useful to some users when editing the arguments to the underlying future.apply() call is not convenient (e.g., the call is in a package).
After the browser() is called, you can enter sink() at the prompt. Output now goes to the terminal. The main caveat to this is that when future.apply attempts to close the sink() connection, there will be a warning because the connection has already been closed:
Warning in base::sink(type = "output", split = FALSE) :
no sink to remove
This is especially annoying if you have the good habit of setting options(warn = 2). To temporarily work around this, you might consider temporarily setting options(warn = 0).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With