Installing package from a local zip file in R

Agnieszka Walczak picture Agnieszka Walczak · May 31, 2016 · Viewed 18.9k times · Source

I am trying to install a package in R from a local zip file. I have the zip file on a local drive, but when I go to Packages --> Install a package from a local zip file I get the following warning:

> utils:::menuInstallLocal()
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : cannot open the connection

In addition: Warning messages:

1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
2: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : cannot open compressed file 'cirt/DESCRIPTION', probable reason 'No such file or directory'

What is going on here?

Many thanks in advance, A

Answer

George Dontas picture George Dontas · May 31, 2016

Try :

install.packages(file.choose(), repos = NULL, type="source")

It will allow you to select the desired zip file.