Hi I'm new to the shiny package, I would like to save a data.frame as an active value and then add rows in several different outputs, taking into account the last modifications
library(shiny)
ui <- fluidPage(
DT::dataTableOutput("table"),
DT::dataTableOutput("table1"),
DT::dataTableOutput("table2")
)
server <- function(input, output) {
values <- reactiveValues(df = data.frame(x = c(1, 2, 3)))
output$table <- DT::renderDataTable({
values$df
})
output$table1 <- DT::renderDataTable({
y <- c(4, 5, 6)
values$df <- rbind(values$df, y)
values$df
})
output$table2 <- DT::renderDataTable({
y <- c(7, "a", 8)
values$df <- rbind(values$df, y)
values$df
})
}
shinyApp(ui, server)