-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decorators: Accepts new snapshot from testthat::test()
#1304
Decorators: Accepts new snapshot from testthat::test()
#1304
Conversation
@@ -50,7 +50,6 @@ | |||
1), decreasing = TRUE) %>% sort_at_path(path = c("AEBODSYS", | |||
"*", "AEDECOD"), scorefun = cont_n_onecol(length(levels(adsl$ACTARM)) + | |||
1), decreasing = TRUE) | |||
pruned_and_sorted_result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, where did this go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the object is decorated.
See code in server function, where the expr = table
is the step that "prints" the table.
Note that the objects now have a standardized name when possible (plot
and table
), allowing for easier re-use of the decorators.
teal.modules.clinical/R/tm_t_events_by_grade.R
Lines 1209 to 1218 in 8a9edd2
table_renamed_q <- reactive({ | |
within(table_q(), table <- pruned_and_sorted_result) | |
}) | |
decorated_table_q <- srv_decorate_teal_data( | |
id = "decorator", | |
data = table_renamed_q, | |
decorators = select_decorators(decorators, "table"), | |
expr = table | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now I understand! thanks @averissimo . in the future, if we consider a series of post processing with tables, will this be captured in a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I fully understand the question, do you mean:
- Add this post-processing after the template generation and decoration?
- As part of the decoration?
- Other?
For 1.
this can be done either on top of decorated_table_q
with eval_code/within
or via the argument expr
that supports any kind of expression just like the within
.
For 2. a list of decorators will allow for a series of post-processing applied to the respective object (table
in this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i meant 1. Thanks @averissimo
Hey @averissimo the job failed https://github.com/insightsengineering/teal.modules.clinical/actions/runs/12359120026 '::' or ':::' import not declared from: ‘rlang’ Other than that this is excellent work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one R CMD CHECK note needs to be satisified to get this merged
I'll fix the rlang issue on the feature branch, let's wait for @shajoezhu to reply here before merging this PR. I'm so used to using rlang that didn't notice we removed that dependency from tmc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks @averissimo
Pull Request
Part of insightsengineering/teal#1371 (comment)
Changes description
plot
,table
or (in case of multiple decoratable elements)<name>_plot
and<name>_table
Workflow
Manually triggered: https://github.com/insightsengineering/teal.modules.clinical/actions/runs/12359120026