pushPATH: Manipulate the System PATH Variable

View source: R/eval.R

pushPATHR Documentation

Manipulate the System PATH Variable

Description

Add or remove entries from the front of the environment variable PATH: the list of directories where the operating system looks for executable files.

Usage

pushPATH(dir)
popPATH()

Arguments

dir

a character string containing a directory to add to the front of Sys.getenv("PATH").

Details

  • pushPATH(dir) adds the directory to the front of PATH, so that the directory is searched before any others when system looks for an executable to run.

  • popPATH(dir) removes the initial entry from PATH.

Altering PATH from within \TERR (or open-source R) affects only where functions like system look for executables to run. It has no effect outside of \TERR, and it is valid only for the current session of \TERR.

Value

pushPATH

returns the value of Sys.getenv("PATH") before it was changed.

popPATH

returns the name of the directory that was removed from PATH.

Note

These functions can be useful when using RCompare, if the default REvaluator objects just specify the name of an intepreter, "R" or "TERR", and not where they are. The RinR package tries to find the full path to the interpreters when the package is loaded, but it is not always successful.

See Also

configureREvaluator gives a more direct way to tell the RinR evaluators where to find the R and TERR executables. RCompare, REvaluator

Examples

## Not run: 
pushPATH("C:/Program Files/R/R-3.0.1/bin")
REvaluate(version$version.string)

## End(Not run)

TIBCOSoftware/RinR documentation built on March 19, 2022, 5:16 p.m.