renderUI shows correct number of tables/plots, but they are identical

Hi everyone,

I found similar code online when searching for a way to display numerous plots and tables in my mainPanel. The number and position of plots is correct, but I always see the same plot and table displayed.

outputT and completeOutputTable are two lists of dataframes.

out <- renderUI({
  out <- list()
  for(i in 1:length(completeOutputTable)){
    currentTable <- outputT[[i]]
    renderedTable <- renderTable(currentTable)
    currentPlottingTable <- completeOutputTable[[i]]
    renderedPlot <- renderPlot(generatePlot(currentPlottingTable))
    out[[i]] <- c(currentTable, renderedTable, currentPlottingTable, renderedPlor)

output$tablesAndGraphs <- out

I added currentTable and currentPlottingTable to out so that I could see what was going on. The values displayed in the app are correct, but renderedTable and renderedPlot always show the same table/plot, namely the very last one from the loop.

Please help. :frowning: