简体   繁体   中英

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:

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.

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. I wonder if it is possible that the newer lattice versions are not compatible with the new R version?

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. 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

>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”这一行来解决了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM