6

Simple question,
is there a function to embedded an existing HTML output, in this case a table output from the stargazer package in R into an R Markdown script?

Nick Reid
  • 63
  • 4
  • If you'd like to render as HTML, you should be able to simply place the HTML in the document. If you'd like to generate the HTML output from R and display as HTML, change the knitr option `result` to `=asis`. – Tad Dallas Jun 16 '16 at 04:19
  • I have an HTML document that I generated with Stargazer. It's in a WD. I want my Markdown file to 'read' it and embedded it in the output. I can embedded the HTML fine, but I don't want it clogging up my rmd. – Nick Reid Jun 17 '16 at 04:07
  • You might be able to use the `iframe` environment in your Rmd. . If not, this answer to [this question](http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file) may help. – Tad Dallas Jun 17 '16 at 04:30
  • @NickReid what did you end up doing? – FalafelPita Nov 18 '17 at 05:19

1 Answers1

0

Horrible cluge, but this is what I did to get an html table into a xargian slide (based on another stack overflow answer). The line showed up in the slide unless I stripped it out.

```{r, echo = FALSE, results='asis'}
t <-readLines("your_html.html")
len <- length(t)-1
cat(t[2:len])
```
adts
  • 71
  • 5