3
votes

I would like to integrate R with sublime text 3.2 and I keep running into problems. I have followed the tutorial from here. I have installed three packages: SublimeREPL, SecondCode, R-Box. I have also changed the path to my R directory.

In SublimeREPL using: "default_extend_env": "default_extend_env": {"PATH": "{PATH};C:\\Program Files\\R\\R-3.5.3\\bin\\x64\\R.exe"},

In R-Box using: "additional_paths": "C:\\Program Files\\R\\R-3.5.3\\bin\\x64\\R.exe"

I also changed the SendCode settings, as described in step 5 of the tutorial I have linked.

However, all this did not work, not least I think because R-Box has no option anymore for R extended. I have googled a bit and turn out that this has been merged into SublimeText. But when I set the syntax to R it still did not compile.

I added R to the system path on windows, thinking maybe this solves the issue. So when I now type R into cmd, it opens R.

After this, using build in Sublime does open R and I can send the code with ctrl+B to it, but this does not seem to allow running: (1) only the current selection of the code (2) running R terminal in a column, rather than in the Sublime Console.

For issue (2) I have installed Terminus, which starts a terminal with open default shell in view where I can start an R, but I can not get sublime to interactively send code to it.

I also tried running SublimeREPL R, but basically nothing happens if I give the command: no error message, no terminal.

I would appreciate if someone managed to get this working and has some tips on what I am missing.

It's windows 10, x64, R-3.5.2 and SublimeText 3.2.

Thanks!

1

1 Answers

5
votes

I managed to sort it out, I detail it here how in case someone else runs into similar issues:

The R-Box package has been superseded and it is no longer maintained. Therefore most of the tutorials online are no longer up to date.

I ended up using a setup of three packages: SendCode, Terminus and Radian.

To set up SendCode I did not do much else than what is described in the question. Before I ran the R script I searched for SendCode Choose Program and selected Terminus. I also started a Terminus R console in another pane of Sublime. From then on the two panes were able to communicate and I could send code snippets with CTRL+ENTER to the R console.

In addition, I ended up installing Radian because it provides highlighted syntax in the terminus R console. For this you need pip and some version of python installed.

Good luck!