mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-13 17:08:05 -05:00
25 lines
455 B
R
25 lines
455 B
R
library(shiny)
|
|
library(ggplot2)
|
|
|
|
|
|
ui <- fixedPage(
|
|
h2("Module example"),
|
|
linkedScatterUI("scatters"),
|
|
textOutput("summary")
|
|
)
|
|
|
|
server <- function(input, output, session) {
|
|
df <- linkedScatterServer(
|
|
"scatters",
|
|
reactive(mpg), # data
|
|
left = reactive(c("cty", "hwy")),
|
|
right = reactive(c("drv", "hwy"))
|
|
)
|
|
|
|
output$summary <- renderText({
|
|
sprintf("%d observation(s) selected", sum(df()$selected_))
|
|
})
|
|
}
|
|
|
|
shinyApp(ui, server)
|