I succeeded to do this with a simple RMarkdown-generated html file in the following way.
-
Generated the file tobeincluded.html
from the standard File | New File | RMarkdown
template
This uses the pandoc
convertor.
-
I use the same convertor to convert the html file to an md file:
$ pandoc tobeincluded.html -f html -o tobeincluded.md -t markdown_strict
-
Include the md file as a child document in the main document:
```{r child='tobeincluded.md'}
```
In your case you would only do steps 2 and 3 and if this works for you is dependent on the quality of the pandoc conversion. I have no experience with converting html documents that are not generated by the RMarkdown-pandoc combination.
I referenced The RMarkdown Cookbook and Converting HTML to Markdown using Pandoc by Brian Cantoni.