Skip to content
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

26 new chunks@main #540

Merged
merged 77 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
7248b5b
Merge branch 'main' into 26_new_chunks@main
gogonzo Jul 26, 2022
e693646
Merge remote-tracking branch 'origin/main' into 26_new_chunks@main
gogonzo Jul 27, 2022
ab858c3
//WIP
gogonzo Jul 27, 2022
85a3a56
Merge remote-tracking branch 'origin/main' into 26_new_chunks@main
gogonzo Jul 27, 2022
bd0283c
WIP
gogonzo Jul 28, 2022
1ccec05
WIP
gogonzo Jul 29, 2022
e7b43af
mmrm
gogonzo Jul 29, 2022
065171c
Merge remote-tracking branch 'origin/main' into 26_new_chunks@main
gogonzo Jul 29, 2022
caa5931
WIP
gogonzo Aug 1, 2022
9a91862
use default constructor for lists
gogonzo Aug 1, 2022
0c98360
26 new chunks mh modules@26 new chunks@main (#544)
gogonzo Aug 4, 2022
1c03a05
tm_t_binary_outcome
mhallal1 Aug 5, 2022
1d2566c
fixes
mhallal1 Aug 5, 2022
125b972
tm_t_events_by_grade
mhallal1 Aug 5, 2022
bbcc7e1
tm_t_events_patyear
mhallal1 Aug 5, 2022
51642cd
tmc - quosure (#542)
Polkas Aug 8, 2022
c1b5a9e
tm_t_summary
Polkas Aug 8, 2022
8aac3af
styler
Polkas Aug 8, 2022
5aaea07
rm |>
Polkas Aug 8, 2022
bb1d806
fix cox
gogonzo Aug 8, 2022
20d29e3
fixes
gogonzo Aug 8, 2022
cdfe74d
fixes
gogonzo Aug 9, 2022
f1d2f70
simplify barchart
gogonzo Aug 9, 2022
1af8bdd
tm_t_tte
gogonzo Aug 9, 2022
0a45970
tm_t_mult_events
gogonzo Aug 9, 2022
881b520
tm_t_summary_by
Polkas Aug 10, 2022
f4a4bf9
tm_g_pp_therapy
Polkas Aug 10, 2022
d96a9d4
tm_g_pp_vitals
Polkas Aug 10, 2022
45c145b
tm_t_abnormality*
Polkas Aug 10, 2022
15c1594
tm_t_exposure
Polkas Aug 10, 2022
df17b95
tm_t_shift* and tm_t_smq
Polkas Aug 10, 2022
27c2844
fix lineplot
Polkas Aug 10, 2022
558b68b
styler
Polkas Aug 10, 2022
9a87c01
use formatters instead
gogonzo Aug 11, 2022
833b1f4
Update tm_t_summary.R
Polkas Aug 11, 2022
7e77f71
bring back anl to validate
gogonzo Aug 11, 2022
0139bcb
fix
gogonzo Aug 11, 2022
88522e2
fixes
gogonzo Aug 11, 2022
bd1109d
remove unnecessary
gogonzo Aug 12, 2022
8791805
fix coxreg
gogonzo Aug 12, 2022
396f1e7
revert wrong fix
gogonzo Aug 12, 2022
d492aa8
Merge remote-tracking branch 'origin/main' into 26_new_chunks@main
gogonzo Aug 18, 2022
6ca29c1
filter_panel_api used conditionally
gogonzo Aug 19, 2022
2b06815
news and small fixes
gogonzo Aug 22, 2022
0bdbc3d
fix heading size in NEWS
gogonzo Aug 22, 2022
495bed6
teal.code:: prefix
Polkas Aug 22, 2022
bf7663a
Merge 495bed6568242152703a8d58b0c0f6a9412349b0 into 71b7517193b63902f…
gogonzo Aug 22, 2022
6ea6c36
[skip actions] Restyle files
github-actions[bot] Aug 22, 2022
e670d3b
FilterPanelAPI
Polkas Aug 26, 2022
f887e69
Merge branch 'main' into 26_new_chunks@main
Aug 26, 2022
370422d
fix tm_g_ci
Aug 26, 2022
cbc007e
update tm_g_ci
Aug 26, 2022
700c0d2
fix tm_g_ci
Aug 26, 2022
4c7da9e
use tmc:::column_annotation_label instead of explicit attr call
gogonzo Aug 31, 2022
2f04203
Merge branch 'main' into 26_new_chunks@main
Aug 31, 2022
6992873
add missing teal.code::
Aug 31, 2022
4751b49
fix typo
Aug 31, 2022
a954b3b
fix typo
Aug 31, 2022
94e1519
add missing arg
Aug 31, 2022
b359609
fix typo
Aug 31, 2022
de8b5a3
fix disable show R code - test with teal.widgets 26_new_chunks@main
gogonzo Aug 31, 2022
091af9d
Update NEWS.md
gogonzo Aug 31, 2022
590ca1d
remove chunks occurrences
gogonzo Aug 31, 2022
3308144
tidyup validations
gogonzo Aug 31, 2022
c402a33
remove unneeded observeEvent
gogonzo Sep 1, 2022
baf49ee
fix tests
gogonzo Sep 1, 2022
8c963d8
fix lintr
gogonzo Sep 1, 2022
6dea952
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Sep 1, 2022
9ff7c08
fix validation issue reported by @mhallal1
gogonzo Sep 1, 2022
2e0633e
fix barchart and forest_rsp as noticed by @mhallal1
gogonzo Sep 1, 2022
414c210
Merge branch '26_new_chunks@main' into origin/main
gogonzo Sep 1, 2022
9e1156c
Merge remote-tracking branch 'origin/main' into 26_new_chunks@main
gogonzo Sep 1, 2022
5e3746c
Merge 9e1156cd3a612c2b74bd81c402acddfbd3786ee8 into 22a020fe55d09bbf7…
gogonzo Sep 1, 2022
481205e
[skip actions] Restyle files
github-actions[bot] Sep 1, 2022
3e48a49
fix ci module
Polkas Sep 1, 2022
5291b82
adding lifecycle to imports after deprecating one of the function
gogonzo Sep 2, 2022
30bc629
Merge remote-tracking branch 'origin/main' into 26_new_chunks@main
gogonzo Sep 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Imports:
ggplot2,
ggrepel,
grid,
lifecycle,
logger (>= 0.2.0),
magrittr,
methods,
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# teal.modules.clinical 0.8.13.9021

### Breaking changes

* Replaced `chunks` with simpler `Quosure` class.
* Replaced `datasets` argument containing `FilteredData` with the new arguments `data` (list of reactive datasets) and `filter_panel_api` (`FilterPanelAPI`).

### Enhancements

* Updated all test files in `tests/testthat/` to `synthetic_cdisc_data("2022_02_28")`
* Reverted missing data checkbox in `tm_t_summary` (encoding and filtering should be separate).
* Implemented a new widget that allows dragging and dropping to select comparison groups.
Expand All @@ -10,10 +16,12 @@
* Added more descriptive title/labels to `tm_g_ci`.

### Bug fixes

* Fixed bug in `tm_g_barchart_simple` which prevented graph from being shown.
* Fixed broken example for `tm_t_abnormality_by_worst_grade`.

### Miscellaneous

* Added `nestcolor` dependency and replaced deprecated function `tern::color_palette` with `nestcolor::color_palette`

# teal.modules.clinical 0.8.13
Expand Down
3 changes: 2 additions & 1 deletion R/argument_convention.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ NULL
#' @param arm_var (`choices_selected` or `data_extract_spec`)\cr
#' object with all available choices
#' and preselected option for variable names that can be used as `arm_var`.
#' It defines the grouping variable(s) in the results table. If there are two elements selected for `arm_var`,
#' It defines the grouping variable(s) in the results table.
#' If there are two elements selected for `arm_var`,
#' second variable will be nested under the first variable.
#' @param arm_ref_comp optional, (`list`)\cr
#' If specified it must be a named list with each element corresponding to
Expand Down
61 changes: 21 additions & 40 deletions R/arm_ref_comp.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#' @param id_ref (`character`) id of reference Treatment input ui element
#' @param id_comp (`character`) id of comparison group input ui element
#' @param id_arm_var (`character`) id of Treatment variable input ui element
#' @param datasets (`FilteredData`) object from the module
#' @param dataname (`character`) dataset name
#' @param data (`reactive` or `data.frame`) dataset used to validate Treatment reference inputs and
#' set `id_ref` input.
#' @param arm_ref_comp (`unknown`) Treatment reference and compare variables provided as a
#' nested list where each Treatment variable corresponds a list specifying the default levels for the
#' reference and comparison treatments.
Expand Down Expand Up @@ -60,30 +60,24 @@ arm_ref_comp_observer <- function(session,
id_ref = "Ref",
id_comp = "Comp",
id_arm_var,
datasets,
dataname = "ADSL",
data,
gogonzo marked this conversation as resolved.
Show resolved Hide resolved
arm_ref_comp,
module,
on_off = shiny::reactive(TRUE),
input_id = "buckets",
output_id = "arms_buckets") {
if (any(unlist(lapply(arm_ref_comp, lapply, inherits, "delayed_data")))) {
stopifnot(
all(vapply(arm_ref_comp, function(x) identical(sort(names(x)), c("comp", "ref")), logical(1)))
)
# when a delayed object is used for arm_ref_comp, the entire FilteredData
# object must be passed to resolve it
arm_ref_comp <- teal.transform::resolve_delayed(arm_ref_comp, datasets)
}

df <- datasets$get_data(dataname, filtered = FALSE)

check_arm_ref_comp(arm_ref_comp, df, module) ## throws an error if there are issues

# uses observe because observeEvent evaluates only when on_off() is switched
# not necessarily when variables are dropped
output[[output_id]] <- shiny::renderUI({
if (!is.null(on_off()) && on_off()) {
df <- if (shiny::is.reactive(data)) {
data()
} else {
data
}

check_arm_ref_comp(arm_ref_comp, df, module) ## throws an error if there are issues

arm_var <- input[[id_arm_var]]

# validations here don't produce nice UI message (it's observe and not render output) but it prevent red errors
Expand All @@ -97,7 +91,6 @@ arm_ref_comp_observer <- function(session,
} else {
unique(arm)
}

default_settings <- arm_ref_comp[[arm_var]]

if (is.null(default_settings)) {
Expand Down Expand Up @@ -150,29 +143,17 @@ check_arm_ref_comp <- function(x, df_to_check, module) {
}


Map(function(xi, var) {
if (!is.list(xi)) {
stop(
msg, "definition for Treatment variable ",
var, " list element needs to be lists with ref and comp elements"
)
}

rc <- names(xi)
if (is.null(rc) || !identical(sort(rc), c("comp", "ref"))) {
stop(msg, "definition for Treatment variable ", var, " nested list needs to have the elements ref and comp")
}


arm_levels <- unlist(xi)

if (!all(arm_levels %in% df_to_check[[var]])) {
stop(
msg, "definition for Treatment variable ",
var, " refers to treatment levels that do not exist in the data"
)
Map(
x, vars,
f = function(xi, var) {
if (!checkmate::check_list(xi) || !setequal(names(xi), c("comp", "ref"))) {
stop(
msg, "definition for Treatment variable ",
var, " list element needs to be lists with ref and comp elements"
)
}
}
}, x, vars)
)
}

invisible(TRUE)
Expand Down
Loading