Gibt es eine Möglichkeit, den DataTable-Ausgang mit seiner Auswahl zu verwenden und diejenigen zu verwenden, die als reaktiver Eingang für die Darstellung markiert sind?In Shiny, ist es möglich, Zeilen aus DT durch Klicken als reaktive Eingabe auszuwählen?
ui <- basicPage(
plotOutput("plot1", click = "plot_click"),
dataTableOutput("table1"),
verbatimTextOutput("info")
)
server <- function(input, output) {
output$table1 <- renderDataTable(({mtcars}))
#figure out a way to reactively select points to point into output$plot1
output$plot1 <- renderPlot({
plot(mtcars$wt, mtcars$mpg)
})
output$info <- renderPrint({
# With base graphics, need to tell it what the x and y variables are.
nearPoints(mtcars, input$plot_click, xvar = "wt", yvar = "mpg")
# nearPoints() also works with hover and dblclick events
})
}
shinyApp(ui, server)
https://shiny.rstudio.com/articles/selecting-rows-of-data.html https://shiny.rstudio.com/gallery/datatables-options.html
Sehen Sie sich https://yihui.shinyapps.io/DT-rows/ – HubertL