R

We ship neither R nor RStudio with the SCC, so you need to install it yourself.

There are basically two options:

  1. Create an apptainer image with everything you need inside
  2. Install RStudio in your home folder and use pixi to create an environment for R

In this guide, we are going to use the second option.

Install pixi

To install pixi, all you need to do is open a terminal and enter:

curl -fsSL https://pixi.sh/install.sh | bash
cp /etc/skel/.bash_profile ~/

Accept all default options. When it is done, you need to restart your terminal.

Now you should get some output when you enter pixi in the terminal.

Prepare an environment

Create some folder where your project is going to live, enter it and issue pixi init:

mkdir my_project
cd my_project
pixi init

This creates a pixi.toml file which contains all the configuration. One important thing to do is to add the following lines to the pixi.toml file:

[system-requirements]
linux = "4.18"

Now you can use pixi add to install the packages you need. For instance, to install the R interpreter and the lme4 package, you would do:

pixi add r-base r-lme4

If you need other packages, search for them on https://anaconda.org. You can, of course, also use the CRAN repository to install packages. (But this might take much more time because the packages need to be compiled in this case.)

Using your environment

To use your environment, you need to enter it. This is done by issuing:

pixi shell

Install RStudio

You need to install RStudio in your home folder. First, you need to download it. Head over to https://posit.co/download/rstudio-desktop/. Make sure to scroll down and choose the "Zip/Tarball" version. Choose the "Fedora 34/Red Hat 8" one.

If you use an interactive session, you can do this in the web browser running inside the session.

You are going to end up with a .tar.gz file that starts with rstudio.

I advise you to create a bin folder in your home folder where you are going to put all your custom installed software. Then install RStudio there:

cd
mkdir bin
cd bin
tar -xzf ~/Downloads/rstudio-1.4.1717-fedora-x86_64.tar.gz

Be aware that the filename you downloaded might be different.

Now, go back to the folder of the project, make sure you are in the pixi environment and start RStudio:

cd
cd my_project
pixi shell
~/bin/rstudio-1.4.1717/rstudio

Also be advised that the folder name might be different, depending on the version you downloaded.