title: Combine / merge multiple HTML documents in r
body: <p>I have a folder with a multiple html files that I would like to combine into one file in R. can be just combined as one long file or (ideally) a more fancy file with table of contents.</p>
  <p>This is to create very simple files to reproduce the problem.</p>
  <pre><code>library(tableHTML)
     
     x=data.frame(x=c(1,2,3))
     y=data.frame(y=c(4,5,6))
     
     
     
     tableHTML::write_tableHTML(tableHTML(x), &quot;x.html&quot;) 
     
     tableHTML::write_tableHTML(tableHTML(y), &quot;y.html&quot;)
  </code></pre>
  <p>I found this package <a href="http://richardhooijmaijers.github.io/R3port/" rel="nofollow noreferrer">http://richardhooijmaijers.github.io/R3port/</a> which has <code>html_combine</code> function. However, when I try the code below, it does not work saying that this is not a raw  html file.</p>
  <pre><code>  library(R3port) 
     
     
     html_combine(
       combine = getwd(), #or whichever folder the html files are stored at
       out = &quot;to.html&quot;,
       toctheme = TRUE,
       css = paste0(system.file(package = &quot;R3port&quot;), &quot;/style.css&quot;),
       clean = 0
     )
  
  </code></pre>
  <p>I get this error: <code>Error in html_combine(combine = getwd(), out = &quot;to.html&quot;, toctheme = TRUE,  :  no raw html files to combine</code></p>
  <p>I have very little experience with HTML and as looking for some  guidance on using this package or any other tool to achieve the task. Combining to pdf should work as well (I was able to do this using adobe software but need to find a way through R to be able to automate the script).</p>
  <p>thank you</p>