title: Remove a file that has been opened within R studio with read.xlsx
body: <p>I am doing a loop on different file and need to read a file extract the information and then delete it. </p>
  
  <p>In R I use the package <code>openxlsx</code></p>
  
  <pre><code>datatemp = openxlsx::read.xlsx(xlsxFile = "./source/aFile.xlsx")
  </code></pre>
  
  <p>However I can't remove the file from windows, it tells me it is open in R studio, I tried to point read.xlsx to another file, and to <code>closeAllConnections</code> but it did not work. </p>
  
  <p>Is there a way to disconnect R from the file without having to close R studio ?</p>
  
  <p>Thanks</p>
  
  <p>Romain</p>