A shiny Module that imports csv file

mod_csv_fileInput(id, label = "CSV file")

mod_csv_file(input, output, session, stringsAsFactors = TRUE)

Arguments

id

shiny id

label

fileInput label

input

internal

output

internal

session

internal

stringsAsFactors

logical: should character vectors be converted to factors?

Examples

library(shiny)
library(DT)
#> 
#> Attaching package: ‘DT’
#> The following objects are masked from ‘package:shiny’:
#> 
#>     dataTableOutput, renderDataTable
if (interactive()){
ui <- fluidPage(
  mod_csv_fileInput("fichier"),
DTOutput("tableau")
)

server <- function(input, output, session) {
  data <- callModule(mod_csv_file,"fichier")
  output$tableau <- renderDT({data()})
}

shinyApp(ui, server)
}