runCurrentRscript: runCurrentRscript

Description Usage Arguments Value See Also

View source: R/addins.R

Description

Wrapper around system2 to run Rscript with default arguments for easy use as an RStudio addin

Usage

1
2
3
4
5
6
7
runCurrentRscript(
  path = path.expand(rstudioapi::getActiveDocumentContext()[["path"]]),
  command = "Rscript",
  outputFile = "output.txt",
  autoOpen = TRUE,
  addRhome = TRUE
)

Arguments

path

character(1) string, specifying the path of the file to be used as Rscript argument (ideally a path to an R script)

command

character(1) to be executed, defaults to "Rscript", which is the originally intended use

outputFile

character(1) string, specifying the name of the file, into which the output produced by running the Rscript will be written

autoOpen

logical(1) should we open the output automatically?

addRhome

logical(1) add R home as prefix to command? Useful if path to R is not added to the "PATH" environment variable

Value

side-effects

See Also

system2


jixing475/manuscriptsJX documentation built on April 20, 2020, 9:55 a.m.