[ESS] remote R via ssh - customizing the command used to start R

Chris Wallace chr|@@w@||@ce @end|ng |rom c|mr@c@m@@c@uk
Tue Jan 5 07:30:39 CET 2016

Dear Stephen,

I confirm that

(defun RserverB ()
         "Run R on serverB using the R.magic script"
         (let ((inferior-R-program-name "/home/USER/bin/R.magic")
     	 (ess-directory "/ssh:USER using serverB:~/"))

works without altering inferior-R-program-name outside the function.  In 
fact, this construct is so much easier than typing the 
/ssh:USER using sarver:~/ each time to connect to a specific server, I have 
now defined RserverA(), RserverC() even for servers which don't require 
the R.magic!

Thank you,


On 04/01/16 22:15, Stephen Eglen wrote:
> Oops you don't need the setq in the let construct.
> On 4 January 2016 21:58:17 GMT+00:00, Stephen Eglen <sje30 using cam.ac.uk> wrote:
>     Thanks for the follow up to the list Chris, glad it works:
>         (defun RserverB ()
>         "Run R on serverA using the R.magic script"
>         (interactive)
>         (setq inferior-R-program-name "/home/USER/bin/R.magic")
>         (setq ess-directory "/ssh:USER using serverB:~/")
>         (R))
>     I think you may need (again untested)
>     (defun RserverB ()
>         "Run R on serverA using the R.magic script"
>         (interactive)
>         (let ((inferior-R-program-name "/home/USER/bin/R.magic")
>     	 (setq ess-directory "/ssh:USER using serverB:~/"))
>           (R)))
>     the let statement means that you only temporarily bind those two
>     variables; otherwise in your version, after running RserverB, you will
>     find that inferior-R-program-name has changed from its default of R.
>     Stephen
>     ------------------------------------------------------------------------
>     ESS-help using r-project.org mailing list
>     https://stat.ethz.ch/mailman/listinfo/ess-help
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.

JDRF/WT Diabetes and Inflammation Laboratory 
NIHR Cambridge Biomedical Research Centre
Cambridge Institute for Medical Research
University of Cambridge


More information about the ESS-help mailing list