I’m trying to run an interactive session on the ARE with Rstudio. I’m assuming that the conda/analysis3 also manages R packages as well as python, and so i was wanting to use it.
However, it looks like using the analysis3 module when starting an Rstudio instance causes an instant crash to my session. The error logs are as follows:
At this stage I would appreciate any feedback on how to:
(1) run Rstudio with analysis3
(2) if this isn’t possible, how to create my own R package environment
If you want to start an R session, there is no need to call conda/analysis3. In fact, you can start a session without editing any of the advanced settings.
The documentation includes instructions with an older version of R (v 4.3) and there was a discussion in a different forum (21st century weather group) that mentioned that these instructions did not apply to R 4.5. This is the link to the thread in case you have access to it: https://21centuryweather.discourse.group/t/r-coding-on-gadi/1414
I haven’t tried to install any packages in the latest version of R, but I’m tagging @paocorrales because she’s like a master of R and may be able to help.
I agree with @lidefi87, you don’t need analysis3 to use R. I’d actually recommend to never use R through conda, the packages are installed in a different way and I’ve seen very weird errors because of that.
The link to the NCI documentation is a good starting point, in summary you install the packages you want in your personal library. There are a few extra details to take into account:
Some packages need system libraries to compile, you will need to load these with module load.
The packages are, by default installed in your home directory and it can add up a lot. There are ways to move that to /g/data to avoid storage issues
Thank you all for your rapid help. I will have a go at creating my custom R environment with the links that have been shared. I’ll let you know on here if I run into any problems.
I actually agree with paocorrales. We have some R packages installed in analysis3 but that is to support some ESMValTool recipes. I don’t think it will be the best approach for interactive analysis. I would recommend creating your own R environment.
I don’t have access to that link in the 21st century weather forum. Could you possibly copy it or screenshot it an share it with me by any chance? Or perhaps post it here?
Here is the important bit from that thread on Cumulus:
It seems that R 4.5.0 was compiled to be more efficient using intel and the specific node architectures of the different types of nodes in Gadi. gcc doesn’t have the same capabilities and if you want to compile any package with it, you need to set specific flags.
By default (and following the NCI documentation) R should use intel to compile packages. If you need to use gcc, you will need to add a Makevars file in ~/.R/Makevars with the necesary flags. NCI suggest to comment/change the name of the file after installing the package.
For R 4.5.0, the content of the Makevars file should be:
x86-64 it may not be the most efficient option but hopefully NCI will update the documentation soon with the recommended option.
I’d suggest to install the packages with only the modules you need. I always start with:
module purge
module load R/4.5.0
module load intel-compiler-llvm/2025.0.4 #compilers used for this R version
module load intel-mkl/2025.0.1 #compilers used for this R version
Trying to use the same compiler NCI used for the specific R version (/apps/R/4.5.0/README.nci). And then I start adding the modules I need for specific packages.
Also, do you have any pointers for making the R session plot/output occur within the R Markdown script? It was doing it for me before, but now for some reason it won’t plot or output summary statistics within the script. Are there any tricks to enabling/removing this sort of functionality?