title: How to easily execute R commands on remote server?
body: <p>I use Excel + R on Windows on a rather slow desktop. I have a full admin access to very fast Ubuntu-based server. I am wondering: how to remotely execute commands on the server?</p>
  
  <p>What I can do is to save the needed variables with <code>saveRDS</code>, and load them on server with <code>loadRDS</code>, execute the commands on server, and then save the results and load them on Windows.</p>
  
  <p>But it is all very interactive and manual, and can hardly be done on regular basis. </p>
  
  <p>Is there any way to do the stuff directly from R, like</p>
  
  <ol>
  <li>Connect with the server via e.g. ssh,</li>
  <li>Transfer the needed objects (which can be specified manually)</li>
  <li>Execute given code on the server and wait for the result</li>
  <li>Get the result.</li>
  </ol>
  
  <p>I could run the whole R remotely, but then it would spawn a network-related problems. Most R commands I do from within Excel are very fast and data-hungry. I just need to remotely execute some specific commands, not all of them. </p>