2016-05-31 90 views
3

我想从本地zip文件安装R中的软件包。我有一个本地驱动器上的压缩文件,但是当我去包 - >从本地zip文件我得到以下警告安装包:从R中的本地zip文件安装软件包

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

另外:警告消息:

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' 

这是怎么回事?

提前许多感谢, 一个

+0

这是RStudio吗? –

+0

可能不是一个确切的副本,但按照其他答案的指示应解决该问题。 –

+0

*“从本地zip文件安装包”*是一个无限更清晰的标题... – smci

回答

8

尝试:

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

它可以让你选择所需的zip文件。

+0

谢谢!但现在我收到以下消息:将软件包安装到'C:/Users/walcza/Documents/R/win-library/3.2' (因为'lib'未指定) untar2中的错误(tarfile,files,list,exdir ,restore_times): 文件上的不完整块 警告消息: 1:运行命令'“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“'状态1 2:在install.packages(file.choose(”cirt“),repos = NULL,type =“source”): 安装包'C:/Windows/System32/cirt/R/cirt'具有非零退出状态 > –

+2

查看与此相关的答案。 http://stackoverflow.com/a/34712100/170792 –

+0

实际上,type =“source”或“binary”,具体取决于zip的内容。 (“二进制”从“mac.binary”/“mac.binary.mavericks”/“win.binary”中自动选择) – smci