What is the best way to work from a Mac-laptop and, send an .Rda-file to an Ubuntu-desktop with the input-data, run the processing, and then later get a new .Rda with the results back to the Mac-laptop?
My R-workflow is mostly about tweaking plots and modifying text in reports (knitr), which I do with a relatively weak Mac-laptop. But a few steps in, I sometimes need to run RJAGS or similar heavy jobs that can take many hours (longer than laptop can stay connected). The input-.Rda can be hundreds of MB large. I also have powerful Ubuntu desktop in another location. It would be great if one could submit also the function to be run.
I thought OpenCpu could be a way, but it seems the laptop must stay connected. Rredis also might be a way forward, but it seems limited in data volume. I already have an SSH-connection between the computers, so perhaps it is best to have some sort of script to send data, send R-script, start R-script, wait, retrieve data. I have already installed RStudio Server on the Ubuntu, and that works well, requires constant connection to the Ubuntu. There are also several multi-computer systems, but as I understand they require computation also on the starting-machine.
I need to do this on an almost daily basis, which is why a robust automatic process would be good.
The simplest trick is to make sure your sessions persist. Which you get "for free" with byobu.
It was originally written for Ubuntu, is of course available on Ubuntu but now also on most other Linux distros as well as OS X. (And it wraps around tmux provided a nicer interface; tmux itself is a retake on screen. Google for 'byobu tmux screen' and you will find countless tutorials.)
To use it, just ssh to the machine in question, laucnh byobu (and optionally have multiple screens and panes--see the video at the site linked above). When it is time to leave just 'detach'. Once you reconnect later from the same or another machine just 're-attach'. Presto.
Edit: Here are a few other answers to R and byobu which will give a general flavour. The tool is absolutely worth it and a key part of the workflow for many advanced users.