teal-clinical-modules

Build clinical trial TFL display apps with teal and teal.modules.clinical modules.

13|6|Updated Aug 9, 2026
One-click install
npx skills add https://github.com/kaipingyang/CDISC_training --skill teal-clinical-modules-kaipingyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: teal-clinical-modules
Source: https://github.com/kaipingyang/CDISC_training/tree/main/.claude/skills/teal-clinical-modules
Command: npx skills add https://github.com/kaipingyang/CDISC_training --skill teal-clinical-modules-kaipingyang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building interactive clinical trial TFL (Tables, Figures, Listings) apps with the teal framework requires knowing the exact parameters of modules like tm_t_summary, tm_t_events, and tm_g_km, plus non-obvious data requirements such as factor-typed arm variables and join keys. This Skill provides official parameter references, minimal runnable examples, and tested workarounds for common errors. ## Core Features & Use Cases - Module Reference: Official usage and parameters for tm_t_summary (baseline characteristics), tm_t_events (AE tables), tm_g_km (Kaplan-Meier curves), tm_data_table (listings), and tm_front_page, organized by TFL category. - Data Preparation Guidance: Patterns for teal_data, join_keys, and the choices_selected / variable_choices / value_choices selectors, including a ready-to-use template for pharmaverseadam data (adsl, adae, adtte_onco). - Troubleshooting Gotchas: Documented fixes for errors like "Treatment variable is not a factor", missing KM arguments, lost variable labels after as.factor conversion, and teal default theme white screens. - Use Case: A clinical programmer needs an interactive app showing a baseline demographics table, an adverse events table, and an OS Kaplan-Meier curve from ADaM datasets; this Skill supplies the full app skeleton and parameter choices. ## Quick Start Ask the AI to build a teal app with a baseline characteristics table and a KM curve using the pharmaverseadam ADSL and ADTTE datasets.

Frequently Asked Questions about teal-clinical-modules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a clinical TFL app with teal.modules.clinical?

Create a teal_data object with your ADaM datasets inside within(), set join_keys with default_cdisc_join_keys, then pass modules like tm_t_summary, tm_t_events, and tm_g_km to init(). Each module needs a dataname and choices_selected selectors for variables.

How to create a Kaplan-Meier plot in a teal app?

Use tm_g_km with dataname set to your TTE dataset and provide the four required arguments: arm_var, paramcd, strata_var, and facet_var. Use value_choices for paramcd to select endpoints like OS, and pass selected = NULL for facet_var if no faceting is needed.

Why does teal report Treatment variable is not a factor?

The arm_var column and other stratification variables must be factor type because the underlying tern package uses factor levels to define groups. Real ADaM data like pharmaverseadam stores these as character, so convert them with dplyr::mutate and as.factor inside within().

What is the difference between variable_choices and value_choices in teal?

variable_choices selects column names from a dataset, such as choosing between ARM and ARMCD for the treatment variable. value_choices selects specific values within one column, such as picking a PARAMCD endpoint like OS or PFS.

Why does my teal app show a blank white page?

Binary teal packages from Posit Package Manager can freeze a build-machine bslib path into the default theme, causing a white screen. Override it after loading teal with options(teal.bs_theme = bslib::bs_theme(version = 5)).

Why does tm_t_summary fail with Data passed has errors?

Converting character columns with as.factor drops variable label attributes, which teal's transform pipeline requires for analysis modules. Restore labels after conversion by copying the label attributes from the original dataset back onto each column.