I have a shiny app which would like to use reactiveFileReader
to dynamically update a data store. Ideally, the new data would be appended to old data, but when I make the assignment within the app, I get the following error:
Error: C stack usage 7970144 is too close to the limit
Here's a (failing) reprex; note that the reactive the_time()
is getting invalidated in order to simulate some new incoming data in lieu of reactiveFileReader
. A functioning app would append times to an ever growing table every second.
library(shiny)
# DOESN"T WORK
# The UI
ui <- fluidPage( tableOutput("timeTable") )
server <- function(input, output, session) {
time_accum <- reactive( data.frame(time = NULL) )
## the_time is a drop in replacement for reactiveFileReeader for this reprex
the_time <- reactive({
invalidateLater(1000, session)
data.frame(time = as.character(Sys.time()))
})
## the key step, which seems to be the fail point
time_accum <- reactive( bind_rows(time_accum(), the_time()) )
output$timeTable <- renderTable( time_accum() )
}
# Run the app
shinyApp(ui = ui, server = server)
Incidentally, below is a version that updates the time, but doesn't accumulate the old values, in case this version is somehow helpful. thanks in advance for any help
library(shiny)
ui <- fluidPage( tableOutput("timeTable") )
server <- function(input, output, session) {
time_accum <- reactive( data.frame(time = NULL) )
## the_time is a drop in replacement for reactiveFileReeader for this reprex
the_time <- reactive({
invalidateLater(1000, session)
data.frame(time = as.character(Sys.time()))
})
## the key step, which seems to be the fail point
#time_accum <- reactive( bind_rows(time_accum(), the_time()) )
output$timeTable <- renderTable( the_time() )
}
shinyApp(ui = ui, server = server)