【发布时间】:2016-10-29 19:14:47
【问题描述】:
我正在尝试将 RMarkdown 编入 html 中,此情节来自 interactivity vignette:
mtcars %>% ggvis(x = ~wt) %>%
layer_densities(
adjust = input_slider(.1, 2, value = 1, step = .1, label = "Bandwidth adjustment"),
kernel = input_select(
c("Gaussian" = "gaussian",
"Epanechnikov" = "epanechnikov",
"Rectangular" = "rectangular",
"Triangular" = "triangular",
"Biweight" = "biweight",
"Cosine" = "cosine",
"Optcosine" = "optcosine"),
label = "Kernel")
)
但我收到以下错误消息:
## Warning: Can't output dynamic/interactive ggvis plots in a knitr document.
## Generating a static (non-dynamic, non-interactive) version of the plot.
【问题讨论】:
-
就在该页面的顶部,它告诉您
Note: If you’re viewing the HTML version of this document generated with knitr, the examples will have their interactive features disabled. You’ll need to run the code in R to see and use the interactive controls.您可以在 Shiny 或启用 Shiny 的 FlexDashboard RMarkdown 中运行它。你也可以看看 is adding some limited client-side controls. -
@alistaire 谢谢,我注意到了,但我之前认为这是可行的,不是吗?这是否意味着ggvis.rstudio.com/interactivity.html 实际上是一个闪亮的应用程序?
-
相信如此,或者它至少在 Shiny 服务器上运行。请注意,它的加载速度比 RStudio 的其他页面要慢一些。
标签: r r-markdown ggvis