[英]Installing lattice in R: “Error : Invalid DESCRIPTION file”
I'm using R 3.0.2 and am trying to install the lattice package, like so: 我正在使用R 3.0.2,并尝试安装grid软件包,如下所示:
install.packages("lattice")
This leads to the following error: 这导致以下错误:
Error : Invalid DESCRIPTION file
Invalid Priority field. Packages with priorities 'base' or 'recommended' or 'defunct-base' must already be known to R.
How can I fix it? 我该如何解决?
Since the DESCRIPTION just seems to contain meta-info, I do not see why this should preclude me from installing the lattice package. 由于DESCRIPTION似乎包含元信息,因此我不明白为什么这会阻止我安装lattice软件包。
Update: 更新:
I have lattice installed, but need a newer version due to some dependencies. 我已经安装了点阵,但由于某些依赖性,需要更新的版本。 Using update.packages()
for lattice returns the same error as above. 对晶格使用update.packages()
返回与上述相同的错误。 I wonder if it is possible that the newer lattice versions are not compatible with the new R version? 我想知道较新的晶格版本是否与新的R版本不兼容?
Seeing BondedDust referring to DESCRIPTION I started investigating it, and it seems the new package has a Priority field in the DESCRIPTION file, but that the old version of the lattice DESCRIPTION file does not. 看到BondedDust引用了Description,我开始研究它,似乎新包在DESCRIPTION文件中有一个Priority字段,但是旧版的DESCRIPTION文件没有。 Why should this matter? 为什么这很重要?
me@tang:~/test_lattice$ grep Priority /home/endrebak/local/anaconda/lib64/R/library/lattice/DESCRIPTION
me@tang:~/test_lattice$ grep Priority lattice/DESCRIPTION #New version
Priority: recommended
I've tried updating the old DESCRIPTION file with a Priority: recommended
line and reloading R, but still 我尝试使用Priority: recommended
行更新旧的Description文件并重新加载R,但是仍然
>rownames(installed.packages(priority="recommended"))
NULL
#rownames(installed.packages(priority="base")) works fine, however.
Full error message below: 完整的错误消息如下:
trying URL 'http://cran.uib.no/src/contrib/lattice_0.20-29.tar.gz'
Content type 'application/x-gzip' length 347091 bytes (338 Kb)
* installing *source* package ‘lattice’ ...
** package ‘lattice’ successfully unpacked and MD5 sums checked
Error : Invalid DESCRIPTION file
Invalid Priority field.
Packages with priorities 'base' or 'recommended' or 'defunct-base' must
already be known to R.
See the information on DESCRIPTION files in section 'Creating R
packages' of the 'Writing R Extensions' manual.
ERROR: installing package DESCRIPTION failed for package ‘lattice’
* removing ‘/home/me/local/anaconda/lib64/R/library/lattice’
* restoring previous ‘/home/me/local/anaconda/lib64/R/library/lattice’
The downloaded source packages are in
‘/tmp/Rtmptpj1ff/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("lattice") :
installation of package ‘lattice’ had non-zero exit status
我通过升级到R 3.2修复了此错误。
我通过删除DESCRIPTION文件中的“ Priority:recommend”这一行来解决了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.