Run remote R in Emacs with ESS

Emacs is a great front-end for most of the command line tools. Although R-Studio is pretty good, I think Emacs/ESS is better. I’ve always used Emacs/ESS to run R, since 2007 on Ubuntu, on Windows, and on my MacBook Pro. It gives me the same experiences across all platforms. I love the way Emacs formatting source codes, and literate programming with Roxygen supported. Unfortunately, ESS does not suport displaying plots in Emacs buffer, which has been supported by imaxima.

As I need to log into the server remotely to run some computationally intensive tasks. I always write and test codes on my MacBook and copy the Rscript file to server by scp command. The Rscript file can be run through screen terminal or using nohup command.

I am wondering is it possible to write R script on my MacBook and send the command to the R running on server directly in Emacs/ESS. After reading the ESS manual, I figure out it is very easy.

In Emacs type "M-x shell" or "M-x eshell" to run the shell. Then in shell, log into server by "ssh -X -C username@serverIP". After logged into server, run R. Finally type "M-x ess-remote" and select “R”.

Screenshot 2013-11-14 00.41.41

Related Posts

  1. You can also run emacs using tramp mode and then invoke a remote R session and an ess buffer and do computation as if locally. Using orgmode and the argument ":session RSessionName" in the code chunk pull all results from different sessions into one literate programming weaved document.


    ygc Hong Kong Unknow Browser Unknow Os Reply:

    good to know the orgmode, thanks.


  2. 我的Emacs配色方案和Y叔的一样, 😆


    ygc Hong Kong Mozilla Firefox Mac OS Reply:

    我又换了,感觉太暗了 :mrgreen:


Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>