无法安装tmap

问题描述

试图安装tmap软件包,但遇到以下错误

install.packages("tmap")
also installing the dependencies ‘tmaptools’,‘sf’,‘stars’,‘classInt’


There are binary versions available but the source versions are later:
          binary source needs_compilation
tmaptools  2.0-2    3.1             FALSE
sf         0.8-1  0.9-5              TRUE
stars      0.4-0  0.4-3             FALSE
classInt   0.4-2  0.4-3              TRUE
tmap       2.3-2    3.1             FALSE

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) no
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/sf_0.8-1.tgz'
Content type 'application/x-gzip' length 53770407 bytes (51.3 MB)
==================================================
downloaded 51.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/classInt_0.4-2.tgz'
Content type 'application/x-gzip' length 77560 bytes (75 KB)
==================================================
downloaded 75 KB


The downloaded binary packages are in
    /var/folders/60/16nrd6w13g33nq3dpr441mgc0000gn/T//RtmphtcoT4/downloaded_packages
installing the source packages ‘tmaptools’,‘tmap’

trying URL 'https://cran.rstudio.com/src/contrib/tmaptools_3.1.tar.gz'
Content type 'application/x-gzip' length 39932 bytes (38 KB)
==================================================
downloaded 38 KB

trying URL 'https://cran.rstudio.com/src/contrib/stars_0.4-3.tar.gz'
Content type 'application/x-gzip' length 4745035 bytes (4.5 MB)
==================================================
downloaded 4.5 MB

trying URL 'https://cran.rstudio.com/src/contrib/tmap_3.1.tar.gz'
Content type 'application/x-gzip' length 2948495 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

* installing *source* package ‘stars’ ...
** package ‘stars’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error : package ‘sf’ 0.8.1 was found,but >= 0.9.0 is required by ‘stars’
ERROR: lazy loading Failed for package ‘stars’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/stars’
Warning in install.packages :
  installation of package ‘stars’ had non-zero exit status
ERROR: dependency ‘stars’ is not available for package ‘tmaptools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tmaptools’
Warning in install.packages :
  installation of package ‘tmaptools’ had non-zero exit status
ERROR: dependencies ‘tmaptools’,‘stars’ are not available for package ‘tmap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tmap’
Warning in install.packages :
  installation of package ‘tmap’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/60/16nrd6w13g33nq3dpr441mgc0000gn/T/RtmphtcoT4/downloaded_packages’

解决方法

将R重新安装到最新版本即可解决问题

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...