title: R - run system call with space in path on Mac
body: <p>I am trying to invoke some system commands on R using <code>system()</code> calls. However, I am having the infamous problem with spaces in the directories.</p>
  
  <p>For example, I am trying to use this directory:</p>
  
  <pre><code>odir &lt;- '/Volumes/Macintosh HD 2/data/cmip5/historical/clt/models'
  </code></pre>
  
  <p>on this command:</p>
  
  <pre><code>system(paste('ls ', odir,sep=''))
  </code></pre>
  
  <p>and I receive the following error:</p>
  
  <pre><code>&gt; system(paste('ls ', odir,sep=''))
  ls: /Volumes/Macintosh: No such file or directory
  ls: 2/data/cmip5/historical/clt/models: No such file or directory
  ls: HD: No such file or directory
  </code></pre>
  
  <p>How can I overcome this?</p>
  
  <p>Thanks!</p>