Description Usage Arguments Value Examples
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
.
1 2 3 4 | readData(input, output, session, path, callback = function() { },
symbol = NULL)
readDataUI(id)
|
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. |
A reactive string representing the code to read the dataset.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
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()})
}
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.