This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ADSL Filter: ARM = "Placebo" AND AGE >= 65 | |
| ↓ | |
| Child Datasets: Only events/medications for elderly placebo subjects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ADAE (Child) Filter: AESEV = "SEVERE" | |
| ↓ | |
| ADSL (Parent) Result: No change - still shows all subjects | |
| ADCM (Sibling) Result: No change - still shows all medications |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ADSL (Parent) Filter: ARM = "Placebo" | |
| ↓ | |
| ADAE (Child) Result: Only AEs for placebo subjects | |
| ADCM (Child) Result: Only medications for placebo subjects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Demonstrate hierarchical filtering with parent-child relationships | |
| hierarchical_demo <- teal::init( | |
| data = coupled_demo_data, | |
| modules = teal::modules( | |
| # Parent dataset view | |
| teal::modules( | |
| label = "👤 Subject Level (Parent)", | |
| tm_t_summary( | |
| label = "Subject Summary", | |
| dataname = "ADSL", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create data with clear relationships to demonstrate coupling | |
| coupled_demo_data <- teal_data() | |
| coupled_demo_data <- within(coupled_demo_data, { | |
| # ADSL - 20 subjects for clear demonstration | |
| ADSL <- adsl[1:20, ] | |
| # ADAE - Only adverse events for first 15 subjects | |
| ADAE <- adae[adae$USUBJID %in% ADSL$USUBJID[1:15], ] | |
| # ADCM - Only concomitant meds for first 10 subjects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Complex filter expressions for sophisticated population definitions | |
| advanced_filters <- teal_slices( | |
| # Complex expression filter | |
| teal_slice( | |
| dataname = "ADSL", | |
| expr = "AGE >= 65 & BMIBL < 30", | |
| title = "Elderly Non-Obese", | |
| id = "elderly_normal_bmi" | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create application with initial filter state | |
| initial_filters <- teal_slices( | |
| # Population definition filters | |
| teal_slice( | |
| dataname = "ADSL", | |
| varname = "ITTFL", | |
| selected = "Y", | |
| title = "Intent-to-Treat Population" | |
| ), | |
| teal_slice( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load and apply saved filter state | |
| # saved_filters <- readRDS("clinical_analysis_filters.rds") | |
| # Apply saved filters to a new application | |
| restored_app <- teal::init( | |
| data = demo_data, | |
| modules = teal::modules( | |
| tm_data_table( | |
| label = "Filtered ADSL Data", | |
| dataname = "ADSL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create and save filter states programmatically | |
| library(teal.slice) | |
| # Define a specific filter state | |
| saved_filters <- teal_slices( | |
| teal_slice( | |
| dataname = "ADSL", | |
| varname = "ARM", | |
| selected = c("Placebo", "Xanomeline High Dose"), | |
| title = "Treatment Groups" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Application with save/restore capabilities | |
| save_restore_demo <- teal::init( | |
| data = demo_data, | |
| modules = teal::modules( | |
| tm_data_table( | |
| label = "ADSL Data", | |
| dataname = "ADSL" | |
| ), | |
| tm_g_distribution( | |
| label = "Age Distribution", |