我使用Plotly with R創建將在R Markdown Presentation With Ioslides呈現的圖表,而是,示出像下面the demo chart from the website:- [R降價演示不加載/渲染交互式Plotly圖表
據渲染步驟是這樣的:
我的代碼非常簡單:
---
title: "R Markdown Presentation & Plotly"
author: "Eduardo Almeida"
date: "February 19, 2017"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Interactive plot with Plotly
```{r}
library(plotly)
p <- plot_ly(economics, x = ~date, y = ~unemploy/pop)
```
使用'suppressPackageStartupMessages({library(plotly)})'來避免打包消息。然後在代碼的最後一行輸入'p'來顯示圖。 –
這就是答案!謝謝,它工作! –