这里的问题并不完全是如何通过R绘制地图,因为我已经发现这里有一个非常好的例子,而是如何让它工作.实际上,我无法加载库rgdal:
library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试手动安装上面的包时,我收到以下错误:
....
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/eualin/R/i686-pc-linux-gnu-library/2.15/rgdal’
Warning in install.packages : installation of package ‘/home/eualin/Downloads/rgdal_0.8-5.tar.gz’ had non-zero exit status
Run Code Online (Sandbox Code Playgroud)
欢迎任何投入!
请指出我遗漏的一点:
openSUSE 11.3
anisha@linux-y3pi:~/Desktop/R> sudo R CMD INSTALL rgdal_0.7-12.tar.gz
root's password:
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: gdal-config: gdal-config
checking gdal-config usability... ./configure: line 1353: gdal-config: command not found
no
Error: gdal-config not found
The gdal-config script distributed with GDAL could not be found.
If you have not installed the GDAL libraries, you can
download the source from http://www.gdal.org/
If you have installed the GDAL …Run Code Online (Sandbox Code Playgroud) 我正在尝试在linux上安装软件包rgeos.我收到以下错误:
system("sudo apt-get update")
system("sudo apt install libgdal-dev -y")
install.packages("rgeos")
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: initGEOS_r not found in libgeos_c.
ERROR: configuration failed for package ‘rgeos’
Run Code Online (Sandbox Code Playgroud)
我已经安装了dev libgdal,如果我再次尝试运行sudo,它会返回"已经安装"的信息.
我怎样才能解决这个问题?提前致谢!