Behavior of "run chunks before" vs "run chunks after"

I regularly use the RStudio "run all chunks before current" and "run all chunks after current" functions in my notebooks. Run chunks before does what I would expect - it starts at the top of the notebook and runs up to, but not including, the current chunk. Run chunks after confounds me in that it runs all chunks after the current chunk, but first executes the current chunk as well. My interpretation of "select all elements after 6 in the sequence 1...10" would be 7, 8, 9, and 10 and not including 6, which is how the RStudio "run all chunks after" feature operates.

The set of run all chunks before, run the current chunk and run all chunks after should, to my mind be equivalent to run all chunks. In the current implementation, these three commands (run before, run current, run after) would result in one chunk (the current) being run twice.

I'm inclined to open an issue on the RStudio repo on this, but would love to hear other opinions/thoughts if my interpretation is out of line. Perhaps there's a more rigorous set-theory driven interpretation that makes this behavior more logical! :nerd_face:

Thanks for the dialog!

1 Like

Issue opened up on RStudio repo for this over at https://github.com/rstudio/rstudio/issues/8661 if anyone cares to plus one or comment. :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.