Running R on the new cluster in VS Code (bonus: installing terra)
How to test R scripts on log in node in VS Code?
- To access the cluster, follow the steps in the Wiki entry on How to access the new HPC2024.
- In the integrated terminal, run
module purge
and thenmodule R/4.3.2
to activate R. You can access R by typingR
into the console and escape withStrg+Z
- In R, install languageserver:
install.packages("languageserver")
- Install the R extension for VS Code (search REditorSupport)
- Create an R script and run lines with
Strg+Enter
. At first, this will create a new console where you might have to log in again via thessh hpc.pik-potsdam.de
command and repeat step 2
Important: Only use the login node to install packages and test small bits of code. Never run heavy computations!
terra
package
Bonus: How to install the First, turn to the related FAQ on this matter. However, if this does not work for you:
- module purge
- module load R/4.3.2 proj geos gdal sqlite3 hdf5/1.14.3 netcdf-c/4.9.2
- inside R: install.packages("terra")