【发布时间】:2017-02-01 23:58:35
【问题描述】:
http://rmarkdown.rstudio.com/authoring_shiny.html 上的示例表明renderPlot 本身将绘图渲染为降价。我们如何获得我们的降价以允许在后续plotOutput 步骤中声明的交互,例如点击、画笔等?
shiny 中的 plotOutput 的交互示例在此处 - http://shiny.rstudio.com/articles/plot-interaction.html。
代码 sn-p -
```{r, echo = FALSE}
output[['Plot1']] = renderPlot(
ggplot(mtcars) + geom_point(aes(x = cyl, y = qsec))
)
renderPlot(
ggplot(mtcars) + geom_point(aes(x = cyl, y = wt))
)
print("renderPlot above. plotOutput below (which doesn't get rendered).")
renderUI({
plotOutput(
'Plot1',
brush = brushOpts(
id = 'Brush1'
),
dblclick = dblclickOpts(id = 'DblClick1'),
click = 'Click1',
height = "100%"
)
})
```
【问题讨论】:
标签: r shiny markdown r-markdown