Run remote R in Emacs with ESS

November 13, 2013
By

(This article was first published on YGC » R, and kindly contributed to R-bloggers)

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.

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. 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

To leave a comment for the author, please follow the link and comment on his blog: YGC » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.