picks version for tm_g_events_term_id#329
Closed
m7pr wants to merge 13 commits into
Closed
Conversation
This was referenced Mar 9, 2026
averissimo
reviewed
Mar 13, 2026
picks version for tm_g_events_term_idpicks version for tm_g_events_term_id
m7pr
marked this pull request as ready for review
May 27, 2026 11:12
Contributor
Code Coverage SummaryDiff against mainResults for commit: 726b039 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Contributor
Unit Tests Summary 1 files 5 suites 0s ⏱️ Results for commit 726b039. ♻️ This comment has been updated with latest results. |
Contributor
Unit Test Performance Difference
Additional test case details
Results for commit d5e54c3 ♻️ This comment has been updated with latest results. |
Merge branch 'redesign_extraction@main' of https://github.com/insightsengineering/teal.osprey into redesign_extraction@main # Conflicts: # R/tm_g_events_term_id_picks.R # man/tm_g_events_term_id.Rd
# Pull Request This partially closes #330 I based my changes [in this PR](#329). Please compare both modules with this example app (requires to have teal.picks installed, osprey) ``` library("teal") library("teal.picks") devtools::load_all() data <- teal_data() %>% within({ library(dplyr) ADSL <- teal.data::rADSL ADAE <- teal.data::rADAE .add_event_flags <- function(dat) { dat <- dat %>% mutate( TMPFL_SER = AESER == "Y", TMPFL_REL = AEREL == "Y", TMPFL_GR5 = AETOXGR == "5", AEREL1 = (AEREL == "Y" & ACTARM == "A: Drug X"), AEREL2 = (AEREL == "Y" & ACTARM == "B: Placebo") ) labels <- c( "Serious AE", "Related AE", "Grade 5 AE", "AE related to A: Drug X", "AE related to B: Placebo" ) cols <- c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2") for (i in seq_along(labels)) { attr(dat[[cols[i]]], "label") <- labels[i] } dat } ADAE <- .add_event_flags(ADAE) }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_g_ae_oview( label = "Common AE (picks)", flag_var_anl = teal.picks::picks( teal.picks::datasets("ADAE"), teal.picks::variables( choices = c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2"), selected = "TMPFL_SER" ) ), arm_var = teal.picks::picks( teal.picks::datasets("ADSL"), teal.picks::variables( choices = teal.picks::is_categorical(min.len = 2), selected = "ACTARMCD" ) ), plot_height = c(600, 200, 2000) ), # Default method (old) for comparison tm_g_ae_oview( label = "Common AE (default)", dataname = "ADAE", flag_var_anl = teal.transform::choices_selected( selected = "AEREL1", choices = teal.transform::variable_choices( data[["ADAE"]], c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2") ) ), arm_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("ACTARM", "ACTARMCD") ), plot_height = c(600, 200, 2000) ) ) ) shinyApp(app$ui, app$server) ``` I refactored the `tm_g_ae_oview` module to create a generic, keep the default for `teal.transform` and add a method for picks variable selection. The module works as expected and setting the variables is better with picks. The issue reported in the similar PR on the plot dimensions is fixed if we set the plot dimensions in the module. The ui of the picks ui components is different and it breaks, in my opinion, the color pattern of the teal app. <img width="1843" height="900" alt="image" src="https://github.com/user-attachments/assets/0a61a8bd-10e7-456c-aff0-ed2d5a099d47" /> <img width="1843" height="900" alt="image" src="https://github.com/user-attachments/assets/0a61a8bd-10e7-456c-aff0-ed2d5a099d47" /> Here the teal.transform module <img width="1843" height="900" alt="image" src="https://github.com/user-attachments/assets/8ce901a8-f106-4bf3-844c-b23358210b33" /> <img width="1843" height="900" alt="image" src="https://github.com/user-attachments/assets/8ce901a8-f106-4bf3-844c-b23358210b33" /> I added simple tests for the module as well --------- Signed-off-by: Oriol Senan <35930244+osenan@users.noreply.github.com> Co-authored-by: osenan <oriol@praenoscere.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
|
This Pull Request is replaced by #341 |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.