我有一个使用Ubuntu 18.04的系统,并将CRAN PPA设置为源。我从那里安装了r-base
软件包:
$ apt policy r-base
r-base:
Installed: (none)
Candidate: 3.6.1-3bionic
Version table:
3.6.1-3bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.6.1-1bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.6.0-2bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.6.0-1bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.5.3-1bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.5.2-1bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.5.1-2bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.5.1-1bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.5.0-1bionic 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
3.4.4-1ubuntu1 500
500 http://nl.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
500 http://nl.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
然后我也从该PPA安装了r-cran-spatial
软件包:
$ apt policy r-cran-spatial
r-cran-spatial:
Installed: 7.3-11-2cranArtful0~ubuntu18.04.1~ppa1
Candidate: 7.3-11-2cranArtful0~ubuntu18.04.1~ppa1
Version table:
*** 7.3-11-2cranArtful0~ubuntu18.04.1~ppa1 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
100 /var/lib/dpkg/status
7.3-11-2build1 500
500 http://nl.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
但是,如果我尝试使用该软件包中的R库,则会收到一条错误消息,指出它是使用其他版本的R安装的:
$ R
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(sp)
Error: package or namespace load failed for ‘sp’:
package ‘sp’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
我在做什么错了?