Skip to content

Conversation

@llrs-roche
Copy link
Contributor

Pull Request

Fixes #495

Replaces the table by a plot on "By Variables Levels" tab.
The colors match those in the other plots of the module.
It also required to add a "new" dependency, formatters, which is a dependency of tern, rlistings, rtable. I added it on Suggests.

There is an extra commit to update the lintr names

data <- within(teal_data(), {
  ADSL <- rADSL
  ADRS <- rADRS
})
join_keys(data) <- default_cdisc_join_keys[names(data)]

init(
  data = data,
  modules = modules(tm_missing_data())
) |> runApp()

@llrs-roche llrs-roche added the core label Oct 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  -------------------------------------------
R/tm_a_pca.R                    864     864  0.00%    141-1132
R/tm_a_regression.R             751     751  0.00%    180-1027
R/tm_data_table.R               200     200  0.00%    100-348
R/tm_file_viewer.R              172     172  0.00%    50-257
R/tm_front_page.R               143     132  7.69%    77-246
R/tm_g_association.R            320     320  0.00%    161-547
R/tm_g_bivariate.R              664     406  38.86%   332-786, 827, 932, 949, 967, 978-1000
R/tm_g_distribution.R          1106    1106  0.00%    156-1404
R/tm_g_response.R               345     345  0.00%    179-594
R/tm_g_scatterplot.R            709     709  0.00%    261-1065
R/tm_g_scatterplotmatrix.R      272     253  6.99%    200-501, 562, 576
R/tm_missing_data.R            1172    1172  0.00%    126-1475
R/tm_outliers.R                1029    1029  0.00%    162-1341
R/tm_rmarkdown.R                154      68  55.84%   144-196, 225-240, 284-285, 345-368
R/tm_t_crosstable.R             263     263  0.00%    177-482
R/tm_variable_browser.R         887     881  0.68%    89-1113, 1164-1347
R/utils.R                       185     120  35.14%   87-250, 279-305, 317-326, 331, 345-364, 453
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9238    8793  4.82%

Diff against main

Filename               Stmts    Miss  Cover
-------------------  -------  ------  --------
R/tm_missing_data.R      +92     +92  +100.00%
TOTAL                    +92     +92  -0.05%

Results for commit: 01d9758

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Unit Tests Summary

  1 files   24 suites   15m 45s ⏱️
157 tests 152 ✅ 5 💤 0 ❌
479 runs  474 ✅ 5 💤 0 ❌

Results for commit 01d9758.

♻️ This comment has been updated with latest results.

@llrs-roche
Copy link
Contributor Author

PR updated, now showing the plot:

image

there was some issues with the required input being linked to an empty string

@llrs-roche
Copy link
Contributor Author

There are differences when tested with ADSL +ADRS data and when using just other data. The problem was mainly with the iris+mtcars used on the tests that require some more relaxed req() calls

App with iris+mtcars (like tests)
dev_mode()
devtools::install()
library("teal.modules.general")

source("tests/testthat/helper-TealAppDriver.R", echo = FALSE)

datat <- within(simple_teal_data(), {
  set.seed(123)
  
  add_nas <- function(x) {
    x[sample(seq_along(x), floor(length(x) * runif(1, .05, .17)))] <- NA
    x
  }
  
  iris[] <- lapply(iris, add_nas)
  mtcars[] <- lapply(mtcars, add_nas)
  mtcars[["cyl"]] <- as.factor(mtcars[["cyl"]])
  mtcars[["gear"]] <- as.factor(mtcars[["gear"]])
})

teal::init(
  data = datat,
  modules = modules(tm_missing_data())
)|> runApp()

@llrs-roche llrs-roche requested a review from averissimo December 2, 2025 12:02
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems ready to be merged.

I have 1 final question regarding borders to further separate the tiles.

Other comments are just technical details

Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com>
Copy link
Contributor Author

@llrs-roche llrs-roche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. Applying the changes and suggesting news ones to keep the module coherent.

llrs-roche and others added 3 commits December 2, 2025 15:23
Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com>
Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com>
@kumamiao
Copy link

kumamiao commented Dec 2, 2025

Thanks @llrs-roche and @averissimo for working on this PR. It looks good to me and I agree with replacing the table with the plot. Agree with Andre to display counts when counts is selected.

@llrs-roche
Copy link
Contributor Author

Thanks for the patch André:

image

Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @llrs-roche !! 💯

@llrs-roche llrs-roche merged commit 2bc2641 into main Dec 3, 2025
29 checks passed
@llrs-roche llrs-roche deleted the 495_plot_missing@main branch December 3, 2025 11:25
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: missing data module - another plot

6 participants