5

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

smci
  • 32,567
  • 20
  • 113
  • 146

1 Answers1

16

Try :

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

It will allow you to select the desired zip file.

gd047
  • 29,749
  • 18
  • 107
  • 146
  • Thank you! But now I get the following message:Installing package into ‘C:/Users/walcza/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) Error in untar2(tarfile, files, list, exdir, restore_times) : incomplete block on file Warning messages: 1: running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\walcza\Documents\R\win-library\3.2" "C:/Windows/System32/cirt/R/cirt"' had status 1 2: In install.packages(file.choose("cirt"), repos = NULL, type = "source") : installation of package ‘C:/Windows/System32/cirt/R/cirt’ had non-zero exit status > – Agnieszka Walczak May 31 '16 at 14:45
  • 2
    See this related answer. http://stackoverflow.com/a/34712100/170792 – gd047 May 31 '16 at 19:02
  • 1
    Actually, type = "source" or "binary", depending on what the zip is. ("binary" selects automatically from "mac.binary"/ "mac.binary.mavericks"/ "win.binary") – smci Feb 26 '17 at 06:19