如何在flexdashboard中渲染googlevis

时间:2016-10-03 11:49:11

标签: r googlevis flexdashboard

我正在尝试将新版软件包FlexDashboard用于GoogleVis,这类似于基本.Rd和shinyDashboards之间的交集。它基本上是一个不闪亮的仪表板。

无论如何,我正在尝试嵌入一个googleVis对象,doesn't seem to be supported by default,但我可以让html显示在输出中,所以必须有办法!我们可以拿出一些黑客吗?也许将plot()renderGvis()some kind of hack结合起来?设置op <- options(gvis.plot.tag='chart')

进行设置

我失败了,但也许其他人可以解决这个问题?

1 个答案:

答案 0 :(得分:3)

基于Michal Majka在Conditional reactive logic shiny based flexdashboard的精彩回答,你可以做这样的事情

---
title: "Test gvisTable"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows

runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
library(googleVis)

```

Column {data-height=350}
-----------------------------------------------------------------------

### Chart c

```{r}
#create a ui interaction:
uiOutput("dynamic")

#render the ui:
output$dynamic <- renderUI({ 
   htmlOutput("myTable")
})

#here is your server activity:
output$myTable <- renderGvis({    
    gvisTable(Population )       
  })
```