title: How can I access hidden system files with R?
body: <p>I am Mac User. Whenever I want to access Mail folder located in the <code>/Users/user_name/Library/Mail</code> folder; RStudio just ignores it and doesn't show any files.</p>
  
  <pre><code>setwd("/Users/user_name/Library/Mail")`
  
  list.dirs("/Users/user_name/Library/Mail")
  &gt; character(0)
  
  list.files("/Users/user_name/Library/Mail")
  &gt; character(0)
  </code></pre>
  
  <p>I understand that because of access to these files requires admin authorization, the R cannot access them. <strong>Is there a way to grant admin access to R to access hidden system files?</strong></p>
  
  <p>This question is <a href="https://community.rstudio.com/t/accessing-hidden-library-folders-in-mac/17786" rel="nofollow noreferrer">cross-posted</a> on RStudio Community forum two days ago. Unfortunately, I couldn't get a reply. That's why I asked here again. </p>
  
  <p><strong>Edit:</strong> Both of <code>list.files()</code> and <code>list.dirs()</code> return nothing.</p>