2016-04-13 3 views
2

Вне Rmarkdown стенда одна googleVis диаграмма работает отлично, но когда я включаю его в Rmarkdown файла я получаю только Rmarkdown Код:GoogleVis графика не оказывающий в Rmarkdown

просмотра Выход:

enter image description here

> 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 код ниже:

--- 
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) 
``` 

ответ

0

г кусок должен быть объявлен как:

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

The "ASIS" очень важно, потому что она возвращает необработанный HTML