首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GoogleVis图表不能在Rmarkdown中呈现

GoogleVis图表不能在Rmarkdown中呈现
EN

Stack Overflow用户
提问于 2016-04-14 03:50:24
回答 1查看 914关注 0票数 4

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

查看器输出:

代码语言:javascript
复制
> 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代码如下:

代码语言:javascript
复制
---
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)

代码语言:javascript
复制
EN

回答 1

Stack Overflow用户

发布于 2016-05-25 23:09:20

R块必须声明为:

代码语言:javascript
复制
```{r plotg0,  results='asis', tidy=FALSE, echo=FALSE}
代码语言:javascript
复制

asis很重要,因为它返回原始HTML

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36608234

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档