Skip to content

Instantly share code, notes, and snippets.

View ZeroLi-Bio's full-sized avatar

ZYLI ZeroLi-Bio

View GitHub Profile
@ZeroLi-Bio
ZeroLi-Bio / eventdata.R
Last active July 11, 2023 07:59 — forked from aagarw30/eventdata.R
Interactive data point selection with ggplotly/plotly charts
## Interactive data point selection with ggplotly/plotly charts, return selected key to variable
## Load required packages
library(plotly)
library(ggplot2)
library(shiny)
## Defining a key column in mtcars which will be used for event handling in event_data()
row.names(mtcars) <- gsub(' ','.',row.names(mtcars))
mtcars$key <- row.names(mtcars)