Return datapoints selected in a plotly scatterplot
问题 I created a plotly scatterplot from a ggplot2 using ggplotly . I would like to obtain a table of the datapoints selected / zoomed into, but I can't find a way to do this. library(ggplot2) library(plotly) p <- ggplotly(plot.rel.kinship) htmlwidgets::saveWidget(as_widget(p), "scatterplot.html") There seems to be a similar unanswered question on the plotly forum: https://community.plot.ly/t/get-datapoints-in-currently-zoomed-view/259 This question also seems to be related: Using Plotly with DT