[R] Start and Restart R over SSH

David Forrest drf5n at maplepark.com
Mon Feb 19 17:15:32 CET 2007


On Mon, 19 Feb 2007, Benilton Carvalho wrote:

> Hi Nils,
>
> if the server you're using is *NIX, this is what you can do:
>
> %%%% example
> ssh user at server
> screen
> R
>
> << do what you need in R>>
> << close the terminal without quitting R >>
>
> ssh user at server
> screen -r
> << continue working in R >>
> %%%%%% end example
>
> the "problem" is if you need X... it works until you quit the
> terminal, but "screen -r" doesn't reconnect the X11.

I find vnc sometimes helps with keeping a X active for an R session.

Also, if you take care to close your x11 devices, and if when you re-ssh 
you happen to get the same forwarded X DISPLAY=localhost:11.0 or whatever, 
the R session in screen will use the new forwarded connection.

It also seems like using Sys.putenv(DISPLAY='localhost:11.0')  overrides 
the DISPLAY that screen's child R session inherits from the initial 
invocation of screen.

Dave
-- 
  Dr. David Forrest
  drf at vims.edu                                    (804)684-7900w
  drf5n at maplepark.com                             (804)642-0662h
                                    http://maplepark.com/~drf5n/



More information about the R-help mailing list