1

Let's say that R is running a computation on Computer A.

Can computer B "take a look" at how this R computation is going on computer A?

Can R send the output (maybe even the created files) to a computer B when the computation is done?

I know R has a sink() function but I don't know how to use it with a distant computer, or even if that woukd be an appropriate way to set things up for my purpose. Should I use a SSH tunnel (whatever that means)?

@Enrico & @Señor O:

Computers A and B are PCs. I don't have admin rights on computer A, so I probably can't install a SSH server or "mount" computer B (does it mean creating a network?) on it.

Maybe I can send myself an email from R though? Saying something like "computation reached this point, here is the output so far..."

I just found here that this might be easily set up. Apparently you can even twitter from R!

Community
  • 1
  • 1
user42174
  • 695
  • 1
  • 6
  • 11
  • 1
    Depends on the machine you're using. On my mac, I can write an R object to another computer mounted on mine via `save(R_Object_Name, file="/Volumes/ComputerName/...")` – Señor O Mar 26 '14 at 20:42
  • I wrote a [blog post](http://johnbaumgartner.wordpress.com/2011/08/19/rbot/) some time ago describing the use of Twitter (via Twidge, although the `twitteR` package should suffice) to send me direct messages that notify me of computation progress and summarise results. You can also have R save files (e.g., plots, `sink` output, etc.) in a Dropbox folder that you can access remotely. There are also some apps that you can install on A, which have web interfaces that you could use to "take a look" from B. I'm not 100%, but think [Logmein](https://secure.logmein.com/UK/) doesn't need install on B. – jbaums Mar 30 '14 at 22:09

2 Answers2

2

If I understand your question, you should be able to do this quite easily with a combination of ssh and tmux (or screen).

Computer A must have a ssh server running.

user@computerB$ ssh computerA.domain.com
user@computerA$ tmux new
user@computerA$ R
> source("myAnalysis.R")
...

Press Ctrl-b d to detach and then Ctrl-d to disconnect from computer A. Now you can shut down your computer, go for a walk, whatever. Then:

user@computerB$ ssh computerA.domain.com
user@computerA$ tmux a
>

R will still be running.

enricoferrero
  • 2,249
  • 1
  • 23
  • 28
0

You should be able to open the .Rout file if you run R in batch mode without interrupting the job. Copy it and open the copy to be extra-safe. As to copying the output, it might be easiest to write a bash script to run R in batch mode and then scp the output files once the job is done.

iacobus
  • 587
  • 3
  • 10