我想使用SublimeREPL在Sublime Text 3中運行R文件。在Preferences -> Browse packages...
文件SublimeREPL\config\R\Main.sublime-menu
中,我加入將R路徑("id" -> "repl_r" -> "cmd" -> "windows"
)Sublime Text 3:運行R文件
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "R",
"id": "SublimeREPL",
"children":
[
{"command": "repl_open",
"caption": "R",
"id": "repl_r",
"mnemonic": "R",
"args": {
"type": "subprocess",
"external_id": "r",
"additional_scopes": ["tex.latex.knitr"],
"encoding": {
"windows": "$win_cmd_encoding",
"linux": "utf8",
"osx": "utf8"
},
"soft_quit": "\nquit(save=\"no\")\n",
"cmd": {"linux": ["R", "--interactive", "--no-readline"],
"osx": ["R", "--interactive", "--no-readline"],
"windows": ["C:/Program Files/R/R-3.2.3/bin/x64/Rgui.exe", "--ess","--encoding=$win_cmd_encoding"]},
"cwd": "$file_path",
"extend_env": {"osx": {"PATH": "{PATH}:/usr/local/bin"},
"linux": {"PATH": "{PATH}:/usr/local/bin"},
"windows": {}},
"cmd_postfix": "\n",
"suppress_echo": {"osx": true,
"linux": true,
"windows": false},
"syntax": "Packages/R/R Console.tmLanguage"
}
}
]
}]
}
]
在工具
然後 - >構建系統 - >新建系統 我將它添加到文件:
{
"target": "run_existing_window_command",
"id": "repl_r",
"file": "config/R/Main.sublime-menu"
}
當我運行file.R
時,R程序啓動並沒有任何反應。
我已經做了python的這些操作,當我啓動一個file.py一個新的選項卡sublime文本打開(稱爲:REPL [python])。當我運行file.R
時,我想要同樣的東西。
(對不起我的英語不好)
我所做的更改,但是當我運行該腳本,該窗口中的「REPL * [R]」打開與文本,R版本3.2.3(2015年12-10)... ...,但寫在腳本中的命令不會掀起
test.R
print(1+1)
我做工具 - >構建和什麼都不顯示
我把:
"windows": "windows": ["C:/Program Files/R/R-3.2.3/bin/x64/R.exe","-f","--ess","--encoding=$win_cmd_encoding"]},
我得到一個錯誤:Fatal error : Can not open file '--ess' : No such file or directory
而且隨着
"windows": "windows": ["C:/Program Files/R/R-3.2.3/bin/x64/Rscript.exe","--ess","--encoding=$win_cmd_encoding"]},
我得到一個錯誤太:
file name is missing
***Repl Closed***
你嘗試用'Rterm.exe'? – MattDMo
我承諾如何使用它,謝謝你的幫助 –