Como gerar dataTableOutput dinamicamente lendo os arquivos .csv em um loop em R brilhante?

Eu tenho uma função que gera "n" quadros de dados e os salva em um local como arquivos csv, e a função retorna o nome do arquivo dos CSVs salvos.

Gostaria de pegar esses arquivos csv, leia-os usandoread.csv() e depois exibi-lo na interface do usuário usando renderUI e renderDataTable ()

Embora o código abaixo não tenha erros de sintaxe, masnada está sendo exibido na tela.

Por favor, sugira um método apropriado pelo qual as tabelas geradas em uma parte do server.R possam ser usadas na saída e exibir essas tabelas de dados na interface do usuário.

O código para a função está abaixo:

Função

GenerateData <- function(){
   #********************************************************************
   # some sample data (originally, my data comes from an external souce)
   #--------------------------------------------------------------------
   a <- 1:10
   b<- 21:30
   c<-41:50
   sampleDat1 <- data.frame(a,b,c)
   sampleDat2<- data.frame(c,a,b,a)
   NumOfDataFrames <- 2
   #--------------------------------------------------------------------
   FilePath <- "D:/FolDerName/"
   FullPath<-WriteStatement <- NULL
   for(i in 1:NumOfDataFrames){

      FullPath[i]<-paste0(FilePath,"sampleDat",i,".csv")
      WriteStatement[i]<-paste0("write.csv(sampleDat",i,",file = '",FullPath[i],"')")
      eval(parse(text=WriteStatement[i]))
   }
   return(FullPath)

}

A UI.r

library(shiny)
shinyUI(

   fluidPage(

      # Application title

      navbarPage("Sample Data Display",
                 tabPanel("Data",
                          sidebarLayout(
                             sidebarPanel(
                                titlePanel("Sample"),
                                numericInput("sample1",label = "Some Label",value = 20),
                                numericInput("sample2",label = "Some Other Label",value = 20)
                             ),
                             mainPanel(
                                uiOutput("result")

                             )
                          )
                 )
      )
   )
)

O server.R

library(shiny)

GenerateData <- function(){
   #********************************************************************
   # already mentioned above, please copy the contents to server.R
   #--------------------------------------------------------------------


}
shinyServer(function(input, output,session) {
   dataSrc <- reactive({
      paths <- GenerateData()
      return(paths)
   })
   output$result <- renderUI({
      dataTab1<-NULL
      MyFilePath <- dataSrc()
      for (i in 1:length(MyFilePath)){
         dataTab1 <- read.csv(MyFilePath[i])
         # print(dataTab1)
         renderDataTable(dataTab1)
         dataTab1<-NULL

      }

   })
}
)

questionAnswers(1)

yourAnswerToTheQuestion