new_rscript {slurmR}R Documentation

General purpose function to write R scripts

Description

This function will create an object of class slurmR_rscript that can be used to write the R component in a batch job.

Usage

new_rscript(
  njobs,
  tmp_path,
  job_name,
  pkgs = list_loaded_pkgs(),
  libPaths = .libPaths()
)

Arguments

njobs

Integer. Number of jobs to use in the job-array. This specifies the number of R sessions to initialize. This does not specify the number of cores to be used.

tmp_path

Character. Path to the directory where all the data (including scripts) will be stored. Notice that this path must be accessible by all the nodes in the network (See opts_slurmR).

job_name

Character. Name of the job to be passed to Slurm.

pkgs

A named list with packages to be included. Each element of the list must be a path to the R library, while the names of the list are the names of the R packages to be loaded.

libPaths

A character vector. See .libPaths.

Value

An environment of class slurmR_rscript. This has the following accessible components:


[Package slurmR version 0.5-4 Index]