SublimeREPL无法找到R [英] SublimeREPL Unable to Find R

查看:251
本文介绍了SublimeREPL无法找到R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这让我发疯.我之前已经进行了设置,删除了Sublime Text,但是现在我不记得正确的配置是什么.

Okay, this is driving my crazy. I had set this up before, deleted Sublime Text, and now I can't remember what the right configuration was.

非常简单:我正在通过SublimeREPL运行R,需要将REPL指向R的安装位置.

Very simple: I'm running R through SublimeREPL and need to point the REPL to where R is installed.

我遵循了 http://sublimerepl.readthedocs.org/en/latest/,表示进入用户定义的REPL设置并添加以下内容:

I followed the directions at http://sublimerepl.readthedocs.org/en/latest/, which say to go into the user-defined REPL settings and add this:

{
 ...
 "default_extend_env": {"PATH": "{PATH}:/home/myusername/bin"}
 ...
} 

其中路径指向正确的目录.我尝试将其替换为

where the path points to the right directory. I tried replacing it with

{
 ...
 "default_extend_env": {"PATH": "C:/Program Files/R/R-3.0.2/bin"}
 ...
}

它仍然找不到R,而且现在它给了我错误:

and it's still unable to find R, plus now it's giving me the error:

Error trying to parse settings: Expected value in Packages\User\SublimeREPL.sublime-     settings:2:2

我知道这很容易解决.有人可以指出我在做什么错吗?

I know this is an easy fix. Can anybody point out what I'm doing wrong here?

*我使用的是Sublime Text3.我以前可以使用此功能,但是使用Sublime Text2.

*I'm using Sublime Text 3. I previously had this working, but on Sublime Text 2.

  • I've been to http://tomschenkjr.net/using-sublime-text-2-for-r/ and the piece where he mentions "pointing SublimeREPL at R" ... he doesn't include the actual code, as far as I can see

我也看到了该线程

I've also seen this thread Error 2 The system cannot find the file specified in Sublime Text 2, Windows 8, but I had it working before and didn't have to do anything along those lines

推荐答案

转到Preferences -> Browse Packages...并创建目录树User/SublimeREPL/config/R.在该目录中,创建一个名为Main.sublime-menu的新文件,其内容如下:

Go to Preferences -> Browse Packages... and create a directory tree User/SublimeREPL/config/R. In that directory, create a new file named Main.sublime-menu with the following contents:

[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "r",
            "id": "SublimeREPL",
            "children":
            [
                {"command": "repl_open",
                 "caption": "Rterm",
                 "id": "repl_r",
                 "mnemonic": "r",
                 "args": {
                    "type": "subprocess",
                    "external_id": "r",
                    "additional_scopes": ["tex.latex.knitr"],
                    "encoding": {"windows": "$win_cmd_encoding"},
                    "soft_quit": "\nquit(save=\"no\")\n",
                    "cmd": {"windows": ["C:/Program Files/R/R-3.0.2/bin/x64/Rterm.exe", "--ess", "--encoding=$win_cmd_encoding"]},
                    "cwd": "$file_path",
                    "extend_env": {"windows": {"PATH": "{PATH}:/C/Program Files/R/R-3.0.2/bin"}},
                    "cmd_postfix": "\n",
                    "suppress_echo": {"windows": false},
                    "syntax": "Packages/R/R.tmLanguage"
                    }
                }
            ]
        }]
    }
]

保存文件,您现在应该具有Tools -> SublimeREPL -> Rterm菜单选项.仔细检查该路径是否是Rterm.exe文件的正确路径.在我的计算机(32位XP)上,它位于bini386子文件夹中,因此您的计算机可能位于bin/x64或类似的文件中.

Save the file, and you should now have a Tools -> SublimeREPL -> Rterm menu option. Double-check that the path is the correct one to the Rterm.exe file. On my computer (32-bit XP) it's in the i386 subfolder of bin, so yours may be in bin/x64 or something like that.

希望这对您有所帮助.

这篇关于SublimeREPL无法找到R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆