I am trying to create a zip file from multiple files using the zip
function in r, but I keep getting this error message:
running command '"zip" -r9X "data.zip" "dt1.txt" "dt2.txt" ' had status 127.
How can I avoid that?
setwd()
dt1 <- sample(1:100, 10)
dt2 <- sample(100:200, 10)
write(dt1, "dt1.txt")
write(dt2, "dt2.txt")
zip('data.zip', files =c('dt1.txt',
'dt2.txt'))
Here is how I solved this problem on my Windows 7 computer:
Rtools
from HERE.Rtools
is installed. In my case it is at C:\Rtools
.C:\Rtools\bin
path to the system path.Adding C:\Rtools\bin
to the system path:
Control Panel >> System and Security >> System
Advanced System Settings
Advanced
tabEnvironmental Variables...
buttonPath
variable and click Edit
buttonC:\Rtools\bin
. If there is already a value, then add ;C:\Rtools\bin
to the end of it. I hope this helps. I found the solution HERE.
I was able to solve the problem by removing the write-protection on ~/Users/<NAME>/Documents/R/win-library
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With