【问题标题】:Installing GDAL in an R Kernel on Google Colab在 Google Colab 上的 R 内核中安装 GDAL
【发布时间】:2021-02-02 06:22:53
【问题描述】:

我正在尝试在我的 colab 会话中安装 R 包 rgdal。我知道它需要依赖 GDAL 才能运行,通常这不是问题。我可以找到很多使用普通 linux 命令安装它的帮助,但找不到任何关于如何从 R 会话安装它的信息。

如果有帮助,这是我的代码:

install.packages("rgdal", dependencies=TRUE,repos='http://cran.rstudio.com/')
Warning message in install.packages("rgdal", dependencies = TRUE, repos = "http://cran.rstudio.com/"):
“installation of package ‘rgdal’ had non-zero exit status” 

有谁知道是否可以使用 R 命令安装 GDAL?还是一种在与 R 内核协作中使用诸如 %%Shell 之类的魔术命令的方法?我是 colab 的新手,但希望我的学生能够使用 R 在 colab 中使用栅格运行脚本。

干杯

【问题讨论】:

    标签: r google-colaboratory gdal rgdal


    【解决方案1】:

    经过大量痛苦的搜索,我找到了答案:

    system("sudo apt-get install libgdal-dev libproj-dev")

    所以 R 告诉 colab 像普通 linux 一样安装依赖项。

    【讨论】:

      猜你喜欢
      • 2021-12-20
      • 2018-09-12
      • 1970-01-01
      • 2020-11-28
      • 1970-01-01
      • 1970-01-01
      • 2021-01-08
      • 2021-12-24
      • 2020-06-01
      相关资源
      最近更新 更多