Вы можете сделать что-то вроде этого:
library(DT)
library(shiny)
ui <- fluidPage(
actionButton("Submit","Submit")
)
server <- function(input, output, session) {
output$Table <- renderDataTable({datatable(mtcars, selection = 'single')})
Clicked <- eventReactive(input$Table_rows_selected,{
input$Table_rows_selected
})
output$selected <- renderText({paste0("You Selected Row: ",Clicked())})
observeEvent(input$Submit,{
showModal(modalDialog( h2("Row Selection Example"),DT::dataTableOutput('Table'),size = "l",br(),textOutput("selected")))
})
}
shinyApp(ui, server)