I produce interactive plots with plotly, and save them as html pages. I'm new to ioslides and Rmarkdown, so I searched through the internet, and found no solution. I want to include a plotly graph with .html extension to my slide. So I tried:
---
title: "Advanced Physics Project"
author: "mcandar"
output:
ioslides_presentation:
widescreen: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Introduction
![my graph](myfile.html)
and it does not work. What I want is a slide with my html graph embedded inside and its interactive features should work properly. Is it possible?
An R Markdown document is written in markdown (an easy-to-write plain text format) and contains chunks of embedded R code, like the document below. --- output: html_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents.
ioslides is one of the presentation format that can be easily put together using R Markdown. It has good compatibility with html, and very easy set-up.
You can embed an R code chunk like this: ```{r} summary(cars) ``` You can also embed plots, for example: ```{r, echo=FALSE} plot(cars) ``` ### Header 3 Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. I tried running this in RStudio v 0.98.
Option 1: Use an iframe:
---
title: "Advanced Physics Project"
author: "mcandar"
output:
ioslides_presentation:
widescreen: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
<iframe src="myfile.html"></iframe>
Option 2: includeHTML
```{r}
shiny::includeHTML("myfile.html")
```
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With