# Class RExecutor

java.lang.Object
picard.util.RExecutor

public class RExecutor extends Object
Util class for executing R scripts.

## Field Summary

Fields
Modifier and Type
Field
Description
`static String`
`GATK_LITE_DOCKER_ENV_VAR`
Name for the environment variable / system property that indicates this is running in the GATK-Lite Docker image.

## Constructor Summary

Constructors
Constructor
Description
`RExecutor()`

## Method Summary

Modifier and Type
Method
Description
`static int`
`executeFromClasspath(String rScriptName, String... arguments)`
Executes the given R script that is stored in a file on the classpath.
`static int`
`executeFromFile(File scriptFile, String... arguments)`
Executes the given R script that is stored in a file by a call to Rscript.
`static boolean`
`runningInGatkLiteDocker()`
Checks for the environment variable / property that indicates this is running in the GATK-Lite Docker image.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### GATK_LITE_DOCKER_ENV_VAR

public static String GATK_LITE_DOCKER_ENV_VAR
Name for the environment variable / system property that indicates this is running in the GATK-Lite Docker image. This is referenced to determine whether R is available.

## Constructor Details

### RExecutor

public RExecutor()

## Method Details

### executeFromClasspath

public static int executeFromClasspath(String rScriptName, String... arguments)
Executes the given R script that is stored in a file on the classpath. The script file is read from the classpath and written to a temp file then executed by a call to Rscript. Blocks until the R script is complete.

Parameters:
  `rScriptName` - the fully qualified name of the classpath resource of the script
  `arguments` - any arguments required by the script
Returns:
  the return code of the R process

### executeFromFile

public static int executeFromFile(File scriptFile, String... arguments)
Executes the given R script that is stored in a file by a call to Rscript. Blocks until the R script is complete.

Parameters:
  `scriptFile` - the file object for the script
  `arguments` - any arguments required by the script
Returns:
  the return code of the R process

### runningInGatkLiteDocker

public static boolean runningInGatkLiteDocker()
Checks for the environment variable / property that indicates this is running in the GATK-Lite Docker image.

Returns:
  true if the environment variable or property is set and is true, false otherwise