Adds a module to support gtsummary#973
Conversation
Code Coverage SummaryDiff against mainResults for commit: 1e27b38 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 38 suites 24m 23s ⏱️ For more details on these errors, see this check. Results for commit 6403bc2. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 7159e43 ♻️ This comment has been updated with latest results. |
osenan
left a comment
There was a problem hiding this comment.
Hi, very good job!
I have provided small comments on function arguments and assertions. I have reviewed the full ui part and all parts of the server that I was confident. The last elements when we "print" the content of the qenv to subsequent qenv looks slightly unknown to me.
I cannot see the table in the example you provided, is it working for you?
On new iteration I will check the documentation.
|
Yes the example works as is for me with the devel version of all packages But I see you want to explore a table which summarizes the same column as you split the table by (so to speak the x and y on the table are the same, so the values are empty). Maybe I should check those arguments and provide an informative error on this case, but I thought that teal would provide the library("gtsummary")
library("dplyr")
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
trial |>
select(age, grade, response) |>
tbl_summary(by = "age", include = "age")
#> 11 missing rows in the "age" column have been removed.
#> Error in `rep_named()`:
#> ! `names` must be `NULL` or a character vector, not an empty integer
#> vector.Created on 2026-02-02 with reprex v2.1.1 Edit: I already put some safeguards to prevent that to happen. |
…dules.general into tm_gtsummary
osenan
left a comment
There was a problem hiding this comment.
Thanks for the changes. I have now tested the app. All the validate::need calls are appearing. Let's find more bugs with more dry runs or with the unit tests let's check the edge cases.
I found this curiosity of calling a hash function on the report:
ADSL <- teal.data::rADSL
stopifnot(rlang::hash(ADSL) == "843e317c3d4aeb88062cd39a9c62fe8a") # @linksto ADSL
.raw_data <- list2env(list(ADSL = ADSL))
lockEnvironment(.raw_data) # @linksto .raw_data
library(crane)
table <- crane::tbl_roche_summary(data = ADSL, by = "SITEID", include = c("SITEID", "ACTARM"), nonmissing = "ifany", percent = "column")
table
Just decide if you want to move the include before the ... or you prefer to keep it where it is. In that case, let's see if it can be set to NULL
|
Waiting to merge to see if we can merge a feature complete module with the work on: |
m7pr
left a comment
There was a problem hiding this comment.
For now reviewed documentation and DESCRIPTION
Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com>
# Pull Request Adds tests for #973 TODO: - [x] Test input - [x] Test UI - [x] Test output On a different PR: - [ ] Test decorators: - [ ] One - [ ] Multiple --------- Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com> Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com>
|
Hey I can confirm I reviewed docs, imports and implementation.
TODO
|
…dules.general into tm_gtsummary




Fixes https://github.com/insightsengineering/coredev-tasks/issues/714
Related to https://github.com/insightsengineering/coredev-tasks/issues/676
Adds 3 more package dependencies: (methods), crane, gtsummary, gt. I haven't added minimal version for them.
We could remove crane dependency at the cost of having less corporate style tables (instead of using
crane::tbl_roche_summary()we could have the vanillagtsummary::tbl_summary().Documentation is mostly imported from other packages.
It involves just 3 functions: the module (is this a good name for such module?), the ui and the server function.
Support to download the table depends on insightsengineering/teal.widgets#335.
Test will come once this branch is reviewed, but known corner case from the module: No
includevariables should select all variables except the one used to split the columnsby.Further modifications of the table should be done via decorators not included on this PR.
Adding decorators might involve modifying
check_decorators()to handle more than one decorator for the same object. This function is duplicated on TMG and TMC and I haven't included on the PR but here is the one I was using:Modified check_decorators to work with multiple decorators for the same object
Example: