在Rmarkdown之外,独立的googleVis图表工作得很好,但是当我将它插入到Rmarkdown文件中时,我只收到了Rmarkdown代码:
查看器输出:

> TEST H 4/13/2016 require(googleVis) Loading required package:
> googleVis Welcome to googleVis version 0.5.10 Please read the Google
> API Terms of Use before you start using the package:
> https://developers.google.com/terms/
>
> Note, the plot method of googleVis will by default use the standard
> browser to display its output. See the googleVis package vignettes
> for more details, or visit http://github.com/mages/googleVis. To
> suppress this message use:
> suppressPackageStartupMessages(library(googleVis))
>
> dttm = data.frame(DT_ENTRY=Sys.Date()-1:20,variable="x",value=1:20)
> g1=gvisAnnotationChart(dttm,datevar="DT_ENTRY",numvar="value",idvar="variable")
> plot(g1) starting httpd help server ... doneRmarkdown代码如下:
---
title: "test"
author: "H"
date: "4/13/2016"
output: html_document
highlight: tango
number_sections: yes
---
```{r}必需(GoogleVis)
dttm = data.frame(DT_ENTRY=Sys.Date()-1:20,variable="x",value=1:20)
g1=gvisAnnotationChart(dttm,datevar="DT_ENTRY",numvar=“值”,idvar=“变量”)
绘图(G1)
发布于 2016-05-25 23:09:20
R块必须声明为:
```{r plotg0, results='asis', tidy=FALSE, echo=FALSE}asis很重要,因为它返回原始HTML
https://stackoverflow.com/questions/36608234
复制相似问题