Rstudio is a general-purpose Integrated Development Environment that is particularly suited for the language R, and popular among R users. You can access Rstudio as an interactive session.  

The first time you do so, you'll probably need to install Rstudio.

To install Rstudio: 

First, if R isn't installed in your environment, you can add r-base via apt-get, or add the channel r to conda's channels, and then add the package r  via conda. See Setting up new or additional languages on Code Ocean for more information

Next, paste the following into your postInstall script (if is is not there already): 


apt-get update && \
    apt-get install -y --no-install-recommends $buildDeps && \
    curl${RSTUDIO_VERSION}-amd64.deb -o rstudio.deb && \
    mkdir -p /etc/rstudio/ && \
    echo server-app-armor-enabled=0 > /etc/rstudio/rserver.conf && \
    gdebi -n rstudio.deb && \
    rm rstudio.deb && \
    apt-get purge -y --autoremove $buildDeps && \
    rm -rf /var/lib/apt/lists/*

This will install Rstudio the next time you start a new run.
Note that RSTUDIO_VERSION  may need to be updated as new releases come out.

To run Rstudio:

From the interactive sessions dropdown, select Rstudio: 

This will trigger a new run accompanied by the words 'Interactive session.' When these words turn blue, click them (they are a link):

To launch Rstudio!

See for more on this IDE.

Five general caveats about interactive sessions on Code Ocean:

  1. Leaving an interactive session running will continuously use quota until you stop the run by clicking the red square in the screenshot above. 
  2. Every 30 minutes, your interactive session will ask you if you are still there. This is to prevent an idly open tab from exhausting your quota. 
  3. When you open an interactive session, you may be prompted to accept notifications from Code Ocean. If you accept, you will receive this half-hourly reminder in your open interactive tab. If you do not accept, it will pop up in the Code Ocean capsule from which you launched the interactive session.
  4. If you do not actively tell Code Ocean that you are still working, every 30 minutes, your session will end and your work will be lost. Please pay attention to these notifications. 
  5. Work done in an interactive session will not be saved to your /code and /data panes. For the time being, please copy and re-implement any changes you wish to save back to your code and data.  

Published capsule with Rstudio installed:

Did this answer your question?