Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R 3.5 package ‘lattice’ was installed by an R version with different internals

I updated R 3.4.4 to R 3.5.0 today. And my package cannot pass R CMD check anymore. It fails at checking whether package can be installed ... ERROR.

In another hand my package works, I can install it and use it as long as I don't check it.

The error is the following:

Error: package or namespace load failed for ‘sp’:
 package ‘lattice’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Error : package ‘sp’ could not be loaded

I tried to reinstall lattice these ways:

sudo apt-get --reinstall install r-cran-lattice

or

remove.packages("lattice", lib="~/R/x86_64-pc-linux-gnu-library/3.5")
install.package("lattice")

The package lattice is installed correctly in both cases. But it does not solve my problem. Also I ensured to have a single version of lattice removing either the r-cran one or the self compiled version. Nothing works.

Edit By the way I can do library(sp) or library(lattice) it works. But not with R CMD check

like image 238
JRR Avatar asked Oct 16 '22 13:10

JRR


1 Answers

The error message tells you that the binary you are attempting to install comes from an insufficient / incompatible R version.

Two fixes:

  1. Install from source as you did. After that check with AP <- available.packages() that you really only have one.

  2. Use the correct binarie: read this README at CRAN and switch to Michael's 'R 3.5' repos. Many of us have been doing that for weeks.

Lastly, the r-sig-debian list is a friendly place for these questions and more. Subscribe first so that you can post.

like image 184
Dirk Eddelbuettel Avatar answered Nov 09 '22 14:11

Dirk Eddelbuettel