我想为rgdal安装"R version 3.2.3 (2015-12-10)"
我下载并安装了

  • GDAL 1.11完整
  • PROJ框架v4.9.2-2
  • GEOS框架v3.5.0-1

  • 来自KyngChaos

    然后在RStudio中,键入install.packages("rgdal"),这给了我:
    > ....
    >
    > configure: CC: clang configure: CXX: clang++ configure: rgdal:
    > 1.1-1 checking for /usr/bin/svnversion... yes configure: svn revision:
    > 572 checking for gdal-config...
    > no no configure: error: gdal-config
    > not found or not executable. ERROR: configuration failed for package
    > ‘rgdal’
    > * removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgdal’
    > Warning in install.packages :   installation of package ‘rgdal’ had
    > non-zero exit status
    
    > sessionInfo()
    R version 3.2.3 (2015-12-10)
    Platform: x86_64-apple-darwin13.4.0 (64-bit)
    Running under: OS X 10.10.5 (Yosemite)
    
    locale:
    [1] de_AT.UTF-8/de_AT.UTF-8/de_AT.UTF-8/C/de_AT.UTF-8/de_AT.UTF-8
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base
    
    loaded via a namespace (and not attached):
    [1] tools_3.2.3
    

    我也在 jetty 尝试过
    R CMD INSTALL rgdal_1.1-1.tar --configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config
     --with-proj-include=/Library/Frameworks/PROJ.framework/Headers
     --with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
    


    sudo R CMD INSTALL –configure-args=’–with-proj-include=/usr/local/lib’ rgdal_1.1-1.tar
    

    没有运气!

    最佳答案

    终于解决了。

    这是我的方法!
    OS X 10.10.5
    R 3.2.3
    GDAL 1.1

  • here下载并安装GDAL完整框架
  • 通过在shell中键入此命令来告诉OS X在哪里可以找到gdal-config文件echo 'export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH' >> ~/.bash_profile,然后source ~/.bash_profile
  • 键入bash gdalinfo --version,检查您的GDAL是否工作正常。那应该回来像GDAL 1.11.3, released 2015/09/16这样的东西。
  • 对于大多数人来说,启动R并键入install.packages("rgdal")是可行的(如果您已完成步骤1-3)。但是,对我而言并非如此。因此,如果仍然遇到问题,请继续执行5。
  • 转到GDAL网站并下载.tar文件。
  • 在shell中,尝试以下操作:sudo R CMD INSTALL –configure-args=’–with-proj-include=/usr/local/lib’ rgdal_1.1-1.tar。那仍然给我一个错误:configure: error: proj_api.h not found in standard or given locations.ERROR: configuration failed for package ‘rgdal’
  • 因此,您再次需要告诉在哪里找到该文件。试试:
  • R CMD INSTALL rgdal_1.1-1.tar --configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config
     --with-proj-include=/Library/Frameworks/PROJ.framework/Headers
     --with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
    

    那应该工作。通过启动R并在R控制台中键入library(rgdal)进行尝试。

    注意:使用rgoes我遇到了类似的问题。 This帮助了我。
    尝试:
    R CMD INSTALL rgeos_0.3-15.tar --configure-args='--with-geos-config=/Library/Frameworks/GEOS.framework/unix/bin/geos-config
    --with-proj-include=/Library/Frameworks/PROJ.framework/Headers
    --with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
    

    用于指向config文件。在这里/Library/Frameworks/GEOS.framework/unix/bin/geos-config

    关于r - 无法安装rgdal,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34333624/

    10-11 23:21