6

Hello Fellow enthusiasts,

I use portable version of R for a project in a computer where I have no administrator privilege. I use zip function to encrypt & zip a folder. Apparently computer doesn't have Rtools and I cannot install it. I am wondering how I can point R to look into a local folder where I have Rtools available (with ../bin/zip.exe) I have tried to add Sys.setenv(zip="folderpath_of_Rtools/bin" in Rprofile.site But it is not working.

Artem
  • 3,304
  • 3
  • 18
  • 41
JeanVuda
  • 1,738
  • 14
  • 29
  • 4
    You can use `R.bat` or `Rpathset.bat` in the batchfiles distribution: https://github.com/ggrothendieck/batchfiles Both can work on a machine without Admin privs. See the documentation in `batchfiles.md` there (or convert it to PDF using `make-batchfiles-pdf.bat` first. – G. Grothendieck Dec 19 '15 at 14:59
  • Also note that R does have an unzip command: `?unzip` – G. Grothendieck Dec 19 '15 at 17:03

1 Answers1

0

The answer was posted by OP in a question body. Transfered to separate answer.

After a reboot, the following code works:

Rtools.bin="C:\\Users\\User_2\\R-Portable\\Rtools\\bin"
sys.path = Sys.getenv("PATH")
if (Sys.which("zip") == "" ) {
    system(paste("setx PATH \"", Rtools.bin, ";", sys.path, "\"", sep = ""))
}
Artem
  • 3,304
  • 3
  • 18
  • 41