Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R() / Rscript(): Calling R / Rscript with identical setup as the main process #13

Open
HenrikBengtsson opened this issue Mar 5, 2016 · 1 comment

Comments

@HenrikBengtsson
Copy link
Owner

Created for Wiki entry.

Wish / Suggestion

Implement functions R() and Rscript() for calling R / Rscript via system() with the option to use identical system setup as the main process, e.g.

  • same system environment variables (e.g. PATH, same .Renviron file, ...)
  • same library paths (.libPaths())
  • same .Rprofile
  • same options()
  • ...

Example:

Rscript("-e"="commandArgs()", seed=34, foo="Hello world!")
@HenrikBengtsson
Copy link
Owner Author

Comment since it's slightly related: R devel just gained tools::Rcmd();

Rcmd <- function(args, ...)
{
    if(.Platform$OS.type == "windows")
        system2(file.path(R.home("bin"), "Rcmd.exe"), args, ...)
    else
        system2(file.path(R.home("bin"), "R"), c("CMD", args), ...)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant