【问题标题】:Configuring R with GRASS GIS使用 GRASS GIS 配置 R
【发布时间】:2014-05-25 16:17:23
【问题描述】:

我刚开始使用 GRASS GIS 7.0.0beta2。我想在 GRASS 中使用 R,反之亦然。按照here 的说明,当我将 WinGRASS-windows 控制台放在前面并键入 R 以在 GRASS 会话中打开 R 会话(命令行模式)时,我收到以下错误:

sh.exe": R: command not found

如何配置 R 和 GRASS,以便我可以在 GRASS 中使用 R,在 R 中使用 GRASS。我在 Windows 7R 3.1.0GRASS GIS 7.0.0beta2 上。

【问题讨论】:

    标签: windows r geospatial spatial grass


    【解决方案1】:

    我是 Linux 用户,所以无法尝试,但在我看来,R bins 目录不在您的PATH 中。

    要对其进行测试,请打开命令行(应为cmd.exe)并尝试

    R
    

    如果输出与上面相同,则将 R bin 目录添加到PATH,这样您就可以从任何您想要的目录调用 R。

    选中following links 之一并将其应用于R bin 所在的目录。

    HTH,让我知道。卢卡

    【讨论】:

    • (+1):感谢@Luca 的帮助。它适用于调用 R 但难以在 R 中调用 GRASS(请参阅提供链接)。任何想法。
    • 你安装spgrass6了吗?哪些命令不起作用,输出是什么?
    • 是的,我已经安装了spgrass6。我的GRASSC:\Program Files (x86)\GRASS GIS 7.0.0beta2。当我使用library(spgrass6) 时,我得到GRASS GIS interface loaded with GRASS version: (GRASS not running)。我尝试使用initGRASS("C:/Program Files (x86)/GRASS GIS 7.0.0beta2", home=tempdir()) 初始化R 中的GRASS,这会产生以下错误消息Error in system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("WINGISRC"))), : 'g.dirseps.exe' not found。再次感谢您的帮助。
    • 用下面的代码得到它:loc <- initGRASS( # "C:/Program Files (x86)/GRASS GIS 6.4.3" "C:/Program Files (x86)/GRASS GIS 7.0.0beta2" , home=getwd() , gisDbase="GRASS_TEMP" , override=TRUE )借用自here
    猜你喜欢
    • 2017-05-02
    • 1970-01-01
    • 2018-05-03
    • 2021-07-17
    • 1970-01-01
    • 1970-01-01
    • 2023-02-15
    • 2022-12-13
    • 1970-01-01
    相关资源
    最近更新 更多