Read data via utils::data
and import it into R. The ui includes a "show
documentation" button to give info about the datasets.
libData(input, output, session, assignTo = "dt", ignoreStyleSheet = TRUE) libDataUI(id, selected = "datasets")
input, output, session | Standard module parameters. |
---|---|
assignTo | A character vector of length one. The symbol to assign the data to in the code. |
ignoreStyleSheet | By default, the R documentation pages use a special
|
id | The module identifier. |
selected | The R package initially selected in the GUI. |
A reactive string representing the import of the dataset. for example.
"data('Arthritis', package = 'vcd')\ndt <- Arthritis"
if (FALSE) { shinyApp( ui = fluidPage( libDataUI("import"), codeOutput("code"), dataTableOutput("table") ), server = function(input, output, session){ code <- callModule(libData, "import") output$code <- renderCode(code()) output$table <- renderDataTable({ eval(parse(text = code())) dt }) } ) }