Skip to content

RStudio in BEAR Portal


Information on running RStudio in BEAR Portal. The instructions assume that you have already logged in.

Launching RStudio in BEAR Portal

From the menu bar at the top of the page, select the ‘Interactive Apps’ menu and then select ‘RStudio Server’. (If you cannot see the ‘Interactive Apps’ menu when you log in to the BEAR Portal this means that you need to follow the steps listed in the Access to BEAR Portal section.)


This will bring up a page for you to specify options for your job, such as:

  • the BEAR project to use
  • the duration for which you want to run the interactive app
  • the QOS to run the job against
  • the number of cores to use in your job.

You also specify which version of R to use and, if required, any meta modules to load. These are selected using the relevant tick boxes and the description of each meta module will link to an information page, from which you can find information on the extra packages or libraries that the meta module will make available in your RStudio instance.


Once you are happy with the selected options, click the ‘Launch’ button at the bottom of the page. When you have done this a BlueBEAR job will be submitted to the cluster.


The length of time you will have to wait for this job to start will depend on the resources you have requested - more cores, or asking for GPUs, will mean that you will likely have to wait longer for the resource to become available.

Once the resource is available you’ll see a ‘Connect to RStudio Server’ button appear on the page. Clicking on this will take you to the RStudio Server instance. When you have finished your work please click on the ‘Delete’ button to stop the job and release the compute resources.



To see information relating to your BEAR Portal jobs please refer to the Portal Job Output page.

Known Issues and Advice

  • It is not possible for a single user to run two instances of RStudio on the same compute node at once
  • If you see a message of The previous R session was abnormally terminated due to an unexpected crash this is because a previous RStudio session was not closed, prior to the underlying Slurm job ending. To close a session cleanly in RStudio, select ‘Quit Session’ from the File menu.
    Note that in most cases this error can be safely ignored, so long as work is being regularly saved.
  • User setting data will not persist between jobs.
  • If you see a message of unable to open connection to X11 display when generating plots in RStudio then you can do one of the following:
    • add options(bitmapType='cairo') before plotting.
    • change the plot command to include type="cairo".
    • add the text: options(bitmapType='cairo') to the file ~/.Rprofile (creating it, if required). This will ensure that the setting persists across each time you load RStudio on BEAR Portal.
  • If you experience RStudio instantly crashing, freezing, or showing an empty window on load then try deleting (or moving aside) the following directories:
    • ${HOME}/.rstudio
    • ${HOME}/.local/share/rstudio
  • If the job is inactive for a long time then you may find yourself logged out of the RStudio Server session. Once this has happened the job is not recoverable. Because of this, any long running R job should either be submitted as a batch job or should regularly checkpoint the data, allowing you to restore this in a future job.