title: Compile .tex with knitr via ssh
body: <p>I have a <code>.Rnw</code> file on a remote machine which I edit via ssh with Aquamacs/Emacs. I don't want to compile the <code>.Rnw</code> locally because it would require to move all the data from the remote to the local memory. 
  When I start to compile the file Emacs correctly ask me to start a data directory in the remote location. Yet after that I get the error</p>
  
  <pre><code>Loading required package: knitr
  Error in setwd(dirname(file)) : cannot change working directory
  </code></pre>
  
  <p>Is it possible to use knitr via ssh?</p>
  
  <p>EDIT: I forgot to mention that <code>knitr</code> will correctly produce a .tex when called from within R with <code>knit(file)</code></p>