r - rgdal "gdal-config"配置错误

标签 r linux installation gdal rgdal

我目前正在 Linux 集群上用 R 运行一些物种分布建模和丰富度映射。为了运行我的分析,我需要安装 rgdal 以便我的建模包中的栅格函数正常工作。我已经安装了 proj4 和 gdal。但是,当我尝试安装 rgdal 时,我收到一条错误消息:

checking for gdal-config... no
no

configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package 'rgdal'

这是我用来安装 rgdal 包的命令:

install.packages("rgdal", configure.args=c("--with-proj-include=/home/nikhail1/bin/proj-4.9.2/bin", "--with-proj-lib=/home/nikhail1/bin/proj-4.9,2/lib"))

然而,尽管存在 gdal-config 错误,gdal 似乎已安装到我的本地系统上(二进制文件和库文件夹存在于我安装它们的地址中)。我在 gdal 安装过程中也没有看到任何错误消息。为什么会出现此错误?我如何让 R 识别已安装此依赖项,或者如果确实存在问题,我该如何识别它?我在网上找到的大多数解决方案都是针对我没有使用的 Debian 和 Ubuntu 系统的。我无权使用 sudo apt-get 或 yum 命令。由于我只安装了 proj 4.9.2,是否缺少任何 gdal 依赖项?

我是 linux 系统以及 rgdal 和 gdal 包的新手。

非常感谢您的帮助

亲切的问候,

尼凯尔

最佳答案

在 Linux 上的 R 中安装 RGDAL

在 R 中运行此命令:

# install package from CRAN
# but specify the library director
# the download method
# and the configuration arguments
# to allow for source installs
install.packages( pkgs = "rgdal"
                    , lib = "./R_Packages"
                    , method = "curl"
                    , configure.args = c(
                                   "--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config"
                                   , "--with-proj-include=/p/home/bin/proj4/include"
                                   , "--with-proj-lib=/p/home/bin/proj4/lib"
                                     ) 
      )

答案来自交叉引用Errors installing rgdal on LINUX system?Trouble installing rgdal .

关于r - rgdal "gdal-config"配置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48668535/

相关文章:

r - 在 R 中测试比例赔率假设

sql - 使用 SQL 语句调试 Shell 脚本时出错到 V_$UNDOSTAT

linux - 在 Mercurial 存储库中,将工作文件夹更改为子文件夹

compilation - Go: "all.bash"编译测试失败 "permission denied"

python:更改 setup.py 以在本地文件系统目录中搜索所需的依赖项

r - R 中的堆栈类 - 更简洁的东西

r - 将国际格式的字符串转换为数字

r - 有没有办法让 RMarkdown 选项卡即使在添加 Shiny 运行时后也能显示?

python - 使用其他 python 包的 .so

python - 编译biopython1.65报错: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1