Running RStudio (1.2) Background Jobs

The forthcoming RStudio 1.2 release has a new “Jobs” feature for running and managing background R tasks.

I did a series of threaded screencaps on Twitter but that doesn’t do the feature justice.

So I threw together a quick ‘splainer on how to run and Python (despite RStudio not natively supporting Python) code in the background while you get other stuff done, then work with the results.

Cover image from Data-Driven Security
Amazon Author Page

8 Comments Running RStudio (1.2) Background Jobs

  1. Pingback: Running RStudio (1.2) Background Jobs – Mubashir Qasim

  2. Randy Lai

    reticulate objects do not work because they are external pointers. You will need to convert them to R objects using py_to_r, then the flow should follow.

  3. jonzadra

    Is there any way to:
    1) start a job using code rather than the gui;
    2) start a job from highlighted code or code in the clipboard rather than having to save it as a separate file?

      1. jonzadra

        I’m curious how you use enslave(). Since the highlighted text would be in source, but you’d have to go to the console to run enslave(), the getActiveDocumentContext() will return the info on the cursor position in the console.

        1. hrbrmstr

          The RStudio Addin handles the basic use-case. enslave() could be modified to work with the clipboard. If you file that as an issue I can likely make time to implement. There are some new changes coming to the RStudio “jobs” API when 1.2 finally comes to life so there will be changes as to how enslave() ultimately works as well.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.