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.
M-x ssh #after this you need to enter your username, remote host and you will be prompted your password
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 -----------
(cons "/home/username/.emacs.d" load-path))
(setq password-cache-expiry nil)
------- end of .emacs file -----------------------
in .emacs.d directory, put the following files
and this one you need so TRAMP doesn't ask password every time you save a