简体   繁体   English

GoogleVis图表无法在Rmarkdown中呈现

[英]GoogleVis chart not rendering in Rmarkdown

Outside of Rmarkdown the stand alone googleVis chart works fine, but when I plug it in the Rmarkdown file I am receiving just the Rmarkdown Code: 在Rmarkdown之外,独立的googleVis图表工作正常,但当我将其插入Rmarkdown文件时,我只收到Rmarkdown代码:

Viewer Output: 查看器输出:

在此输入图像描述

> 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 ... done

Rmarkdown Code Below: 下面的Rmarkdown代码:

---
title: "test"
author: "H"
date: "4/13/2016"
output: html_document
highlight: tango
number_sections: yes
---

```{r}
require(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)
```

The r chunk has to be declared as: r块必须声明为:

```{r plotg0,  results='asis', tidy=FALSE, echo=FALSE}

The "asis" is important because it returns raw HTML “asis”很重要,因为它返回原始HTML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM