Various visualisations

RStudio provides an easy-to-use, integrated environment for developing and running R code and RMarkdown documents.

You can install RStudio on your own machine, for example using AppsAnywhere, however this can be limiting since your own computer may not offer access to the resources required for large scale analysis i.e. sufficient RAM, or enough disk storage for your data.

As an alternative, we provide access to a server based version of RStudio, which is accessed through a web browser. This has a number of benefits:

  1. Access to up to 64Gb RAM
  2. Direct access to the cluster filesystem. This means you do not need to transfer data backwards and forwards between the cluster and your computer to work in R.
  3. Data backup: Any data stored on the cluster filesystem is automatically backed up, so your data is protected from loss through the same backups as other cluster data.

Despite these advantages, there are cases where using your own RStudio installation can be better.

  1. User contention: As a multi-user environment, the RStudio server resources are shared between all the people using the system at a time. This may limit the amount of memory available to you at any one time.
  2. The CPUs accessible via the RStudio Server may not be as fast as those in your own computer, so you may get better performance using local resources.

Should you choose to use your own computer for RStudio rather than the RStudio Server, you must take steps to ensure your data is adequately protected i.e. copying completed analysis results back onto the cluster filesystem.

The RStudio Server is available to anyone with an HPC cluster account.

  1. Click here: https://rstudio.compbio.dundee.ac.uk
  2. Enter your SLS credentials (N.B. The username should be that you use to login to the cluster, not your email address)

rstudio sign-in dialog

RStudio Server has access to the cluster filesystem, and by default your sessions will start with your home directory as the R working directory, so the 'getwd()' command should return the path of your home directory. The file browser (found under the 'Files' tab in the pane on the bottom right of the interface), also shows your home directory by default.

rstudio sign-in dialog

If you need to use a working directory outside your home directory, you can use 'setwd()' with the absolute path of the directory you need to access, or click the 'three dots' icon in the files tab (highlighted in red below), and enter the path of the directory you wish to use. This will then change the directory shown in the File browser. You can then click 'More' (highlighted in yellow below), and select 'Set as Working Directory'

rstudio sign-in dialog

A small number of additional packages are centrally installed, but for the most part you should install your own packages as required. R will install these within a directory in your home directory.

You can either install packages using the conventional R `install.packages` command, or through the 'Packages' tab in the bottom right pane of the interface.

R Upgrades

R packages are generally not compatible between different versions of R, so it will be necessary to reinstall your packages when the R installation on the server is upgraded. A tool like Renv should be able to help you recreate the same set of packages following an upgrade