DT::renderDataTable dynamic update

I would like to create a table from a data.frame using DT::renderDataTable

When the data.frame is updated elsewhere in my code, I would like to re-render the table.

Could someone please provide some guidance on how to proceed?



This is usually achieved by making your data frame reactive. Simple example below.


ui <- fluidPage(
  numericInput("nrows", "Number of rows", value = 5, min = 1, max = 100),

server <- function(input, output, session) {
  data <- reactive({
    x <- rnorm(n = input$nrows)
    data.frame(x = x)
  output$data <- renderDataTable({

shinyApp(ui = ui, server = server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.