Embedding existing HTML in R markdown
Asked Answered
J

1

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?

Jarrett answered 16/6, 2016 at 2:6 Comment(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.Saline
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.Jarrett
You might be able to use the iframe environment in your Rmd. <iframe src='path/to/your/file/html' ></iframe>. If not, this answer to this question may help.Saline
@NickReid what did you end up doing?Abbey
C
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])
```
Cream answered 17/5, 2019 at 23:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.