安装适用于Linux的R包时出错

Tan*_*nt3 23 linux packages r

我试图在R 3.3上安装名为"rgeos"的软件包,但是当我输入时

install.packages("rgeos")
Run Code Online (Sandbox Code Playgroud)

但它返回以下错误(与其他包相同,但不是所有包):

> * 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
Run Code Online (Sandbox Code Playgroud)

有什么线索如何安装这个包?

Tan*_*nt3 37

似乎在Linux中运行R时需要安装一些构建工具.在这种情况下,在终端:

sudo apt-get install libgeos-dev
Run Code Online (Sandbox Code Playgroud)

然后再次尝试打包安装.

从这里提示

  • 作为替代方案:`sudo apt-get install libgeos ++ - dev` (4认同)