Skip to contents

Teal Core Functions

These are the main functions needed to build a teal app.

init()
Create the Server and UI Function For the Shiny App
module() toString(<teal_module>) print(<teal_module>)
Creates a teal_module object.
modules() toString(<teal_modules>) print(<teal_modules>)
Creates a teal_modules object.
srv_teal_with_splash()
Server function that loads the data through reactive loading and then delegates to srv_teal().
ui_teal_with_splash()
UI to show a splash screen in the beginning, then delegate to srv_teal()

Example module

A simple example teal module

example_module()
An example teal module

Report previewer module

reporter_previewer_module()
Create a teal module for previewing a report

Functions for module developers

new_tdata() get_code(<tdata>)
Create a tdata Object
get_code_tdata()
Wrapper for get_code.tdata This wrapper is to be used by downstream packages to extract the code of a tdata object
get_join_keys()
Function to get join keys from a tdata object
get_metadata()
Function to get metadata from a tdata object
tdata2env()
Function to convert a tdata object to an environment Any reactives inside tdata are first evaluated
show_rcode_modal()
Show R Code Modal

Validation functions

validate_has_data()
Validate that dataset has a minimum number of observations
validate_has_elements()
Validates that vector has length greater than 0
validate_has_variable()
Validates that dataset contains specific variable
validate_in()
Validates that vector includes all expected values
validate_inputs()
Send input validation messages to output.
validate_n_levels()
Validate that variables has expected number of levels
validate_no_intersection()
Validates no intersection between two vectors
validate_one_row_per_id()
Validate that dataset has unique rows for key variables

Deprecated functions

get_rcode()
Returns R Code from a teal module
get_rcode_srv()
Server part of get R code module
get_rcode_ui()
Ui part of get R code module