Skip to content

Instantly share code, notes, and snippets.

View KKulma's full-sized avatar

Kasia KKulma

  • Data Science Consultant
  • London
  • X @KKulma
View GitHub Profile
@KKulma
KKulma / shiny-select-group-from-plot
Created February 12, 2019 13:36
The app demonstrates how to fetch group info information from `plot_click` attribute and use it to subset a `dataTableOutput`.
library(shiny)
library(ggplot2)
library(DT)
### The app demonstrates how to fetch group info information from `plot_click` attribute and use it to subset a `dataTableOutput`.
### redoing the SO answer from https://stackoverflow.com/a/38919892/6327771 (example 2)
ui <- fluidPage(
# selectInput("var_y", "Y-Axis", choices = names(iris)),
library(shiny)
library(ggplot2)
### redoing the SO answer from https://stackoverflow.com/a/38919892/6327771 (example 2)
ui <- fluidPage(
# selectInput("var_y", "Y-Axis", choices = names(iris)),
plotOutput("distPlot", dblclick = "plot_click"),
uiOutput("dynamic")