我使用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'来显示图。 –
这就是答案!谢谢,它工作! –