我试图在R 3.3上安装一个名为“rgeos”的软件包,但是当我键入

install.packages("rgeos")

但是它返回了以下错误(与其他软件包一样,但并非所有软件包都相同):
> * installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: gcc
configure: CXX: g++
configure: rgeos: 0.3-19
checking for /usr/bin/svnversion... no
configure: svn revision: 524
checking for geos-config... no
no
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/home/kdg/R/x86_64-pc-linux-gnu-library/3.3/rgeos’
>
> The downloaded source packages are in
>   ‘/tmp/Rtmpsa5pDo/downloaded_packages’ Warning message: In
> install.packages("rgeos") :   installation of package ‘rgeos’ had
> non-zero exit status

有什么线索如何con安装此软件包?

最佳答案

似乎在Linux上运行R时必须安装一些构建工具。在这种情况下,在终端中:

sudo apt-get install libgeos-dev

然后再次尝试安装软件包。

hints from here

关于r - 为Linux安装R软件包时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38924767/

10-08 23:42