...
For longer running non-interactive use cases call R in batch.
First, create the your file, e.g. demo.r
containing commands for R, which contains R syntax.
Next, create the file your batch job file, e.g. r-job.srun
, and add the desired slurm declarations, module(s), and call to the application.
...