This question already has answers here:
How should I deal with “package 'xxx' is not available (for R version x.y.z)” warning?

(18 个回答)


6年前关闭。




在 OSX Mavericks 上的新 R 版本中安装某些软件包时遇到困难。 rgeosrgdal 都返回例如:
package 'rgeos' is available as a source package but not as a binary

Warning in install.packages :
  package 'rgeos' is not available (for R version 3.1.1)

在我的 Windows 系统上,R 3.1.1 的两个软件包都安装得很好,所以这是 Mavericks/OSX 版本问题还是我的构建有问题?更改库存储库没有任何区别。我看过从二进制文件构建,但例如在 rgeos homepage 上,它指出“OS X Mavericks 二进制文件:r-release:不可用”,所以我被斯诺克了。

多谢指教。

编辑:

尝试@Andrie 的建议:
> install.packages('rgeos', type='source')
Installing package into ‘/Users/robinedwards/Library/R/3.1/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.ma.imperial.ac.uk/src/contrib/rgeos_0.3-6.tar.gz'
Content type 'application/x-gzip' length 240510 bytes (234 Kb)
opened URL
==================================================
downloaded 234 Kb

* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: clang
configure: CXX: clang++
configure: rgeos: 0.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 450
checking geos-config usability...
./configure: line 2056: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ‘rgeos’
* removing ‘/Users/robinedwards/Library/R/3.1/library/rgeos’
Warning in install.packages :
  installation of package ‘rgeos’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/_s/ppznw4sx7p51kwv__hj3d8540000gn/T/RtmpK40xj7/downloaded_packages’

以及构建页面的屏幕截图:

最佳答案

您需要从源代码安装 rgdalrgeos

  • 首先安装包rgeos
  • 然后从源安装 rgdal

  • 试试这个:
    install.packages('rgeos', type="source")
    install.packages('rgdal', type="source")
    

    10-07 19:57