title: Write a function in R to process docx files
body: <p>I have a folder that contains *.docx files. I want to convert the script below into some sort of a loop function to read all docx files but I really dont know how to write R function and someone please guide me?</p>
  
  <pre><code>library(docxtractr)
  real_world &lt;- read_docx("C:/folder/doc1.docx")
  docx_tbl_count(real_world)
  tbls &lt;- docx_extract_all_tbls(real_world)
  a &lt;- as.data.frame(tbls)
  </code></pre>
  
  <p>So ideally it appends new table everytime a new document is extracted.</p>
  
  <p>Thanks
  Peddie</p>