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")

Arguments

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 css sheet for styling. Set this option to FALSE to load this style sheet.

id

The module identifier.

selected

The R package initially selected in the GUI.

Value

A reactive string representing the import of the dataset. for example.

"data('Arthritis', package = 'vcd')\ndt <- Arthritis"

Examples

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 }) } ) }