Sublime Text 2 and R

I am trying to use Sublime Text 2 as an interface for R statistics software [update / edit: Solved!].

On Windows, I tried the following:

  • Installed tools R. It turned out that for Macintosh 64 only.

  • I tried to program a custom build file. Failure: the output does not return.

    { "cmd": "C:/Program Files/R/R-2.9.2/bin/R.exe --no-save $File" } 
  • Installed SublimeREPL. Error: the menu option R ... is disabled

  • [update / edit] Tried this (see wuub answer):

     { "default_extend_env": {"PATH": "{PATH};C:\\Program Files\\R\\R-2.9.2\\bin"} } 
+7
source share
4 answers

Open the SublimeREPL user settings as follows: Preferences -> Package Settings -> SublimeREPL -> Settings - User

set default_extend_path to point to your R installation:

 { "default_extend_env": {"PATH": "{PATH};C:\\Program Files\\R\\R-2.14.2\\bin\\i386"} } 

Launch Tools -> SublimeREPL -> R should launch REPL, as expected.

+9
source

For Windows, you can add a new assembly for R (Tools -> Build System -> New Build System) and place the following lines. Change the path according to your installation directory R.

 {"cmd": ["Rscript.exe", "$file"], "path": "C:\\Program Files\\R\\R-2.15.2\\bin\\x64\\", "selector": "source.r"} 

You can execute the whole file by pressing ctrl + B instead of running SublimeREPL.

+2
source

The value of the build system must be an array, so you want;

 { "cmd": ["C:/Program Files/R/R-2.9.2/bin/R.exe", "--no-save", "$File"] } 

http://docs.sublimetext.info/en/latest/file_processing/build_systems.html#file-format

+1
source

For Linux users, note:

Sublime Text 2 R build System

It supports multi-segment and interactive R sessions.

0
source

All Articles