To run R:

  1. Prepare to run script.

  2. Clean up after running script.

  3. Prepare to run a callback.

  4. Clean up after running a callback.