-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add picks variable selection to ae_oview module #331
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
060314d
975ae0a
b6fd8f6
d68f94a
3dd972e
89ecbea
630f5bf
2869ce9
c2f07a3
bf70fff
88fbf7e
8bd9bd3
584c88b
b3f3eb0
e00faee
440b9fe
5abc2ca
df0f269
b7219f0
640f80e
6e6e222
73c6f60
8ca1bc1
0e4d1bc
af68495
e5e9dad
5f0cfc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,21 +1,27 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| #' Teal module for the `AE` overview | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @title Teal module for the `AE` overview | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @description | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' Display the `AE` overview plot as a shiny module | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' This is an S3 generic that dispatches on the class of `flag_var_anl`: | ||||||||||||||||||||||||||||||||||||||||||||||
| #' - [choices_selected][teal.transform::choices_selected()] dispatches to the | ||||||||||||||||||||||||||||||||||||||||||||||
| #' default method. | ||||||||||||||||||||||||||||||||||||||||||||||
| #' - [picks][teal.picks::picks()] dispatches to the picks method. | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @inheritParams teal.widgets::standard_layout | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @inheritParams teal::module | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @inheritParams argument_convention | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @param flag_var_anl ([`teal.transform::choices_selected`]) | ||||||||||||||||||||||||||||||||||||||||||||||
| #' `choices_selected` object with variables used to count adverse event | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @param flag_var_anl Either a ([`teal.transform::choices_selected`]) | ||||||||||||||||||||||||||||||||||||||||||||||
| #' `choices_selected` object or a (`[picks][teal.picks::picks()]`) | ||||||||||||||||||||||||||||||||||||||||||||||
| #' object with variables used to count adverse event | ||||||||||||||||||||||||||||||||||||||||||||||
| #' sub-groups (e.g. Serious events, Related events, etc.) | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @param dataname (`character(1)`) Name of the events dataset. Required when | ||||||||||||||||||||||||||||||||||||||||||||||
| #' using the default method with [choices_selected][teal.transform::choices_selected()]. | ||||||||||||||||||||||||||||||||||||||||||||||
| #' Ignored by the `.picks` method. | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @inherit argument_convention return | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @inheritSection teal::example_module Reporting | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @export | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @examples | ||||||||||||||||||||||||||||||||||||||||||||||
| #' data <- teal_data() %>% | ||||||||||||||||||||||||||||||||||||||||||||||
| #' within({ | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -47,7 +53,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||
| #' join_keys(data) <- default_cdisc_join_keys[names(data)] | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' ADAE <- data[["ADAE"]] | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' # Using default method (choices selected) | ||||||||||||||||||||||||||||||||||||||||||||||
| #' app <- init( | ||||||||||||||||||||||||||||||||||||||||||||||
| #' data = data, | ||||||||||||||||||||||||||||||||||||||||||||||
| #' modules = modules( | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -73,14 +79,40 @@ | |||||||||||||||||||||||||||||||||||||||||||||
| #' shinyApp(app$ui, app$server) | ||||||||||||||||||||||||||||||||||||||||||||||
| #' } | ||||||||||||||||||||||||||||||||||||||||||||||
| #' | ||||||||||||||||||||||||||||||||||||||||||||||
| #' @export | ||||||||||||||||||||||||||||||||||||||||||||||
| tm_g_ae_oview <- function(label, | ||||||||||||||||||||||||||||||||||||||||||||||
| dataname, | ||||||||||||||||||||||||||||||||||||||||||||||
| arm_var, | ||||||||||||||||||||||||||||||||||||||||||||||
| flag_var_anl, | ||||||||||||||||||||||||||||||||||||||||||||||
| dataname = NULL, | ||||||||||||||||||||||||||||||||||||||||||||||
| arm_var = teal.picks::picks( | ||||||||||||||||||||||||||||||||||||||||||||||
| teal.picks::datasets(), | ||||||||||||||||||||||||||||||||||||||||||||||
| teal.picks::variables( | ||||||||||||||||||||||||||||||||||||||||||||||
| choices = teal.picks::is_categorical(min.len = 2), | ||||||||||||||||||||||||||||||||||||||||||||||
| selected = 1L | ||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||
| flag_var_anl = teal.picks::picks( | ||||||||||||||||||||||||||||||||||||||||||||||
averissimo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||
| teal.picks::datasets(), | ||||||||||||||||||||||||||||||||||||||||||||||
| teal.picks::variables( | ||||||||||||||||||||||||||||||||||||||||||||||
| choices = teal.picks::is_categorical(min.len = 2), | ||||||||||||||||||||||||||||||||||||||||||||||
| selected = 1L | ||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| arm_var = teal.picks::picks( | |
| teal.picks::datasets(), | |
| teal.picks::variables( | |
| choices = teal.picks::is_categorical(min.len = 2), | |
| selected = 1L | |
| ) | |
| ), | |
| flag_var_anl = teal.picks::picks( | |
| teal.picks::datasets(), | |
| teal.picks::variables( | |
| choices = teal.picks::is_categorical(min.len = 2), | |
| selected = 1L | |
| ) | |
| ), | |
| arm_var = teal.picks::variables( | |
| choices = teal.picks::is_categorical(min.len = 2), | |
| selected = 1L | |
| ), | |
| flag_var_anl = teal.picks::variables( | |
| choices = teal.picks::is_categorical(min.len = 2), | |
| selected = 1L | |
| ), |
You can then overwrite arguments with picks() in tm_g_ae_oview.variables (and use dataname):
# ...
arm_var <- teal.picks::picks(datasets(dataname), arm_var)
flag_var_anl <- teal.picks::picks(datasets(dataname), flag_var_anl)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.
Changed, actually it is simpler good idea
Uh oh!
There was an error while loading. Please reload this page.