Learn R Programming

teal (version 0.16.0)

example_module: An example teal module

Description

[Experimental]

Usage

example_module(
  label = "example teal module",
  datanames = "all",
  transformators = list(),
  decorators = list()
)

Value

A teal module which can be included in the modules argument to init().

Arguments

label

(character(1)) Label shown in the navigation item for the module or module group. For modules() defaults to "root". See Details.

datanames

(character) Names of the datasets relevant to the item. There are 2 reserved values that have specific behaviors:

  • The keyword "all" includes all datasets available in the data passed to the teal application.

  • NULL hides the sidebar panel completely.

  • If transformators are specified, their datanames are automatically added to this datanames argument.

transformators

(list of teal_transform_module) that will be applied to transform module's data input. To learn more check vignette("transform-input-data", package = "teal").

decorators

[Experimental] (list of teal_transform_module) optional, decorator for object included in the module.

Examples in Shinylive

example-1

Open in Shinylive

Details

This module creates an object called object that can be modified with decorators. The object is determined by what's selected in Choose a dataset input in UI. The object can be anything that can be handled by renderPrint(). See the vignette("transform-module-output", package = "teal") or teal_transform_module to read more about decorators.

Examples

Run this code
app <- init(
  data = teal_data(IRIS = iris, MTCARS = mtcars),
  modules = example_module()
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

Run the code above in your browser using DataLab