title: Compute the size of directory in R
body: <p>I want to compute the size of a directory in R. I tried to use the <code>list.info</code> function, by unfortunably that follows the symbolic links so my results are biased:</p>
  
  <pre><code># return wrong size, with duplicate counts for symlinks
  sum(file.info(list.files(path = '/my/directory/', recursive = T, full.names = T))$size)
  </code></pre>
  
  <p>How do I compute the file size of a directory, so that it gives me the same result as on Linux, e.g. with <code>du -s</code> for example?</p>
  
  <p>Thanks</p>