Die Beispiele auf http://rmarkdown.rstudio.com/authoring_shiny.html zeigen an, dass renderPlot
selbst das Diagramm zum Abschlag darstellt. Wie können wir unseren Abschlag erhalten, um Interaktionen wie Klicks, Pinsel usw. zuzulassen, die als Teil des nachfolgenden Schritts plotOutput
deklariert sind?Interaktive ggplot in Markdown
Interaktivität Beispiele mit plotOutput
in shiny
hier - http://shiny.rstudio.com/articles/plot-interaction.html.
-Code-Schnipsel -
```{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%"
)
})
```