Shiny module for reading data into R. currently, the formats .csv, .sav, .xlsx, .rds and .Rdata are supported. the following formats will be mapped .txt -> .csv, .xls -> .xlsx.

readData(input, output, session, path, callback = function() { },
  symbol = NULL)

readDataUI(id)

Arguments

input, output, session

Standard module parameters.

path

A reactive value representing the path of the file to be read.

callback

A function that will be called in case of unsupported formats. Should have no arguments.

symbol

Optional: A symbol to use in the import code in place of the path. This is useful if the path has previously been saved as a variable.

id

The module identifier.

Value

A reactive string representing the code to read the dataset.

Examples

if (FALSE) { shinyApp( fluidPage( textInput("path", "choose a path", value = "mtcars.csv"), readDataUI("readDataId"), codeOutput("code") ), function(input, output, session){ code <- callModule(readData, "readDataId", reactive(input$path)) output$code <- renderCode({code()}) } ) }