Run remote R in Emacs with ESS
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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”.
Related Posts
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.