Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Aquamacs in Mac OS X and Emacs in Linux/unix can be used to edit remote (and local) R code and submit pieces of code to a remote R session. For this to work you need to install ess for emacs (Aquamacs comes with ess by default now, I don’t know about emacs). If you don’t have ess, you can install following this recipe.

open an R script using emacs, you can open remote files using TRAMP. You need to do C-x C-f and enter the remote location as “/ssh:[email protected]:/home/username/example.R”. After you opened your remote R script, now you have to start a remote R session. First, we need to ssh to remote host from Emacs/Aquamacs using the following commands.

R #start R
M-x ess-remote #after starting R, you need to start and ess-remote session,
so your R script and R session is connected.

Now you can edit your remote script and also send code to your remote R session from
your script. If you can't ssh from Emacs/Aquamacs you will need to install ssh.el.
First prepare a .emacs file, put it in your home folder. Also, make .emacs.d folder
your home directory. You will put the  .el files in this directory.
------contents of .emacs  file -----------

(require 'tramp)

(require 'ssh)

------- end of .emacs file -----------------------

in .emacs.d directory, put the following files

http://www.splode.com/~friedman/software/emacs-lisp/src/ssh.el

or

ftp://ftp.splode.com/pub/users/friedman/emacs-lisp/ssh.el

and this one you need so TRAMP doesn't ask password every time you save a
file