I have a number of different HTML files that contain formatted tables which I would like to combine in a knitr report in R. Unfortunately, I have some issues in loading the HTML files into R and including the tables in my knitr report.
The HTML files were created using the "save as htm" function in MS Excel and the stargazer library. They display flawlessly in any browser. My code is:
```{r, echo=FALSE, return='asis'}
library(XML)
overview.html <- htmlParse("overview.htm")
print(overview.html)
```
When printing "overview html" in the console I get the correct html code. However, when kniting the report the output document does not contain my code and I get the following error:
Warning message:
XML content does not seem to be XML: 'overview.htm'
I have tried several variations of the above (using htmlTreeParse, using the print type = "html" option etc.) to no avail. It would be great if someone could suggest a way how this might work.