I need to unpack zip and rar archives, also that must be a multiplatform solution.
In R you can unpack zip easily by command
unzip(filename, exdir=‘’)
But I found I can’t unpack rar files that way. On OS X I can simply open archive to unpack it, if I have unarchiver configured that way:
system(paste("open", path))
I googled, that 7zip can be installed and do unpacking from console, so I’ve tried installr package for Windows
require(installr)
install.7zip()
system(paste("7z x", path))
but I get warning and nothing happens
running command '7z x 1.rar’ had status 127
and terminal command for Unix
system('sudo apt-get install p7zip-rar')
system(paste("7z x ", path))
but it returned error with sudo
sudo: no tty present and no askpass program specified