我试图在R滑动中生成谷歌运动图表。我在网上查了很多例子,似乎有些人已经成功将Google运动图嵌入到R滑动幻灯片中。然后当我使用类似的代码尝试我自己的时候,它给了我空白的结果。我也用同样的方法制作一个谷歌饼图和它运作良好(饼图显示在绘图区)gvisMotionChart在R中返回空格plotify
下面是我下面的简化代码(这里我用的是水果数据集就像所有其他演示):
---
title: "Title"
author: "Me"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output:
ioslides_presentation:
incremental: yes
transition: default
widescreen: yes
slidy_presentation:
incremental: yes
job: Job Title
license: by-nc-sa
mode: selfcontained
hitheme: tomorrow
highlighter : highlight.js
subtitle: Subtitle
framework: io2012
widgets: []
---
## GoogleVis Motion chart example
```{r motionchartcode1, results='asis', warning=FALSE, comment=NA}
library(googleVis)
options(gvis.plot.tag='chart')
M <- gvisMotionChart(Fruits, 'Fruit', 'Year',
options=list(width=400, height=350))
#plot(M)
print(M, tag = 'chart')
```
---
## GoogleVis Pie chart example
```{r motionchartcode, results='asis'}
library(googleVis)
options(gvis.plot.tag='chart')
Pie <- gvisPieChart(CityPopularity,
options=list(width=400, height=200))
print(Pie, tag = 'chart')
```
然后我用slidify("demo.Rmd")
将它编译成html文件。第一张幻灯片没有绘制任何绘图,而是绘制了一个空白区域。
我不确定哪个部分影响到这个结果:---
部分中的设置,r降级块或我的浏览器环境中的选项?
希望有人可以给我的想法。