如何在 flexdashboard 中渲染 googlevis
How to render googlevis in flexdashboard
我正在尝试将 GoogleVis 与新包 FlexDashboard 一起使用,它就像基本的 .Rd 和 shinyDashboards 之间的交集。它基本上是一个没有光泽的仪表板。
无论如何,我正在尝试嵌入一个 googleVis 对象,doesn't seem to be supported by default, but I can get the html to show up in the output, so there must be a way! Can we come up with some hack? Maybe combining either plot()
or renderGvis()
combined with some kind of hack?设置 op <- options(gvis.plot.tag='chart')
?
我失败了,但也许其他人可以解决?
基于 Michal Majka 在 的出色回答,您可以做这样的事情
---
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 )
})
```
我正在尝试将 GoogleVis 与新包 FlexDashboard 一起使用,它就像基本的 .Rd 和 shinyDashboards 之间的交集。它基本上是一个没有光泽的仪表板。
无论如何,我正在尝试嵌入一个 googleVis 对象,doesn't seem to be supported by default, but I can get the html to show up in the output, so there must be a way! Can we come up with some hack? Maybe combining either plot()
or renderGvis()
combined with some kind of hack?设置 op <- options(gvis.plot.tag='chart')
?
我失败了,但也许其他人可以解决?
基于 Michal Majka 在
---
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 )
})
```