I would like to run R files in Sublime Text 3 using SublimeREPL. In Preferences -> Browse packages...
in the file SublimeREPL\config\R\Main.sublime-menu
, I added the R path ("id" -> "repl_r" -> "cmd" -> "windows"
)
[
{
"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"
}
}
]
}]
}
]
then in tools - > build system - > new build system I add it to the file:
{
"target": "run_existing_window_command",
"id": "repl_r",
"file": "config/R/Main.sublime-menu"
}
When I run a file.R
, the R program launches and nothing happens.
I have already made these manipulations for python and when I launch a file.py a new tab sublime text opens (called : REPL [ python ] ) . I want the same thing when I run a file.R
.
(sorry for my bad English)
I made the changes but when I run the script, the window "REPL*[r]" opens with the text: R Version 3.2.3 ( 2015-12-10 ) ..., but the commands written in the script does not set off
test.R
print(1+1)
i do tool -> builds and nothing is displayed
I put :
"windows": "windows": ["C:/Program Files/R/R-3.2.3/bin/x64/R.exe","-f","--ess","--encoding=$win_cmd_encoding"]},
I get a error : Fatal error : Can not open file '--ess' : No such file or directory
And with
"windows": "windows": ["C:/Program Files/R/R-3.2.3/bin/x64/Rscript.exe","--ess","--encoding=$win_cmd_encoding"]},
I get a error too :
file name is missing
***Repl Closed***