[R] how to save an R object to a remote computer

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Sun Oct 23 21:03:58 CEST 2011


On Sun, Oct 23, 2011 at 7:46 PM, Molly Davies <mollymdavies at gmail.com> wrote:
> Hello,
>
> I am running R remotely on my university's network from my laptop (Macbook Pro, running leopard, in case this is useful). I have a strict limit on how much disk space I can take up on my network account at school, which is insufficient for the size of some of the objects I need to create. Is there any way to use save() and write.table() in R to export directly to a remote machine (in this case that would be my laptop, which has plenty of room)? I need to save vectors of lists of lists (output from mclapply). So far, my search has led me to various database utilities. I suppose I could try to make that work, but I've no experience with databases and am unsure if that is the best way for me to go.
> Any advice (including search terms I might not have thought of yet) would be much appreciated.

 The easiest way would be to do this at the operating system level -
not using R. Some kind of shared file system between the computers.
How are you running R remotely? What OS is the remote machine? Are you
using connecting to a Windows machine via RDP (Remote Desktop) or a
Linux box with SSH or something else?

 With RDP its possible to tell the remote desktop program to mount
local drives (such as hard disks or USB drives) as extra drives on the
remote windows box (so you see extra K:,J: etc drives). Then you'd
just get R to write to K:\something\ and its going straight on your
laptop.

 For a remote Linux machine you might be able to use SSHFS to create a
connection to your laptop from the server.

 However these things will probably rely on things being installed on
the server and possibly friendly network technicians. Sometimes the
real easiest solution involves smiling sweetly to the people who
control the disk space, and if that doesn't work get your supervisor
to try it...

I'll just check you're not one of our students...

Barry



More information about the R-help mailing list