Skip to content

Commit

Permalink
Reorganize and group defaults for stats and their default formats/lab…
Browse files Browse the repository at this point in the history
…els -> addition of auto for DMT01 (#1051)

Fixes #994 (for now)

Still todo:

- [x] tests for filtering
- [x] Examples
- [x] Evaluate the effect of having a list instead of a character vector
(it was the second, I am more inclined towards first)
- [x] start deprecation of `summary_formats`, `summary_labels`
- [x] discuss: consider changes in `summary_custom` (to discuss with
@edelarua)
- [x] wontdo: replace it within `count_occurences` and
`summarize_num_patients` (once reworked, wont do for now)
- [x] wontdo: consider using automatic function name getter for calling
function (related to previous. Not necessary until reworked)
- [x] wontdo: start deprecating other defaults (not related for now)

---------

Signed-off-by: Davide Garolini <dgarolini@gmail.com>
Signed-off-by: Davide Garolini <davide.garolini@roche.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Emily de la Rua <59304861+edelarua@users.noreply.github.com>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Sep 11, 2023
1 parent 9e4dd1f commit ec8c413
Show file tree
Hide file tree
Showing 75 changed files with 1,457 additions and 708 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ Collate:
'summarize_glm_count.R'
'summarize_num_patients.R'
'summarize_patients_exposure_in_cols.R'
'summary_stats.R'
'survival_biomarkers_subgroups.R'
'survival_coxph_pairwise.R'
'survival_duration_subgroups.R'
'survival_time.R'
'survival_timepoint.R'
'utils.R'
'utils_checkmate.R'
'utils_default_stats_formats_labels.R'
'utils_factor.R'
'utils_grid.R'
'utils_rtables.R'
9 changes: 7 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Generated by roxygen2: do not edit by hand

S3method(a_summary,default)
S3method(a_summary,numeric)
S3method(as.rtable,data.frame)
S3method(h_coxreg_inter_effect,character)
S3method(h_coxreg_inter_effect,factor)
Expand Down Expand Up @@ -113,6 +111,7 @@ export(fit_logistic)
export(fit_rsp_step)
export(fit_survival_step)
export(forest_viewport)
export(format_auto)
export(format_count_fraction)
export(format_count_fraction_fixed_dp)
export(format_extreme_values)
Expand All @@ -128,7 +127,10 @@ export(g_km)
export(g_lineplot)
export(g_step)
export(g_waterfall)
export(get_formats_from_stats)
export(get_labels_from_stats)
export(get_smooths)
export(get_stats)
export(groups_list_to_df)
export(h_adlb_worsen)
export(h_adsl_adlb_merge_using_worst_flag)
Expand Down Expand Up @@ -278,6 +280,8 @@ export(tabulate_rsp_biomarkers)
export(tabulate_rsp_subgroups)
export(tabulate_survival_biomarkers)
export(tabulate_survival_subgroups)
export(tern_default_formats)
export(tern_default_labels)
export(test_proportion_diff)
export(to_n)
export(to_string_matrix)
Expand All @@ -300,6 +304,7 @@ importFrom(magrittr,"%>%")
importFrom(methods,new)
importFrom(rlang,.data)
importFrom(stats,pchisq)
importFrom(stats,setNames)
importFrom(survival,Surv)
importFrom(survival,coxph)
importFrom(survival,strata)
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
### New Features
* Added `imputation_rule` function to apply imputation rule to data.
* Added new format function `format_sigfig` to allow for numeric value formatting by a specified number of significant figures.
* Added vectors containing default statistic formats and labels as `tern_default_formats` and `tern_default_labels`, respectively.
* Added function `get_stats` to return methods from given statistical method groups.
* Added function `get_formats_from_stats` to return formats and `get_labels_from_stats` to return labels for a given set of statistics.
* Added `"auto"` option for `.formats`. It uses `format_auto` to determine automatically the number of digits.

### Enhancements
* Refactored `tabulate_rsp_subgroups` to pass sanitation checks by preventing creation of degenerate subtables.
* Updated `analyze_vars_in_cols` to use caching, allow implementation of imputation rule via the `imp_rule` argument, and allow user to specify cell alignment via the `.aligns` argument.
* Updated `add_rowcounts` to allow addition of row counts from `alt_counts_df` using the `alt_counts` argument.

### Miscellaneous
* Grouped functions relating to valid method names and their default formats and labels into new source file `utils_defaults_handling.R`.
* Started deprecation of `summary_custom()` and `a_summary()` as a `S3` method.
* Renamed statistical method for `p-value` in the discrete case to `pval_counts`.
* Removed `a_summary_internal()` in favor of only one main `a_summary()`.

# tern 0.9.0
### New Features
* Added `stat_propdiff_ci` function to calculate proportion/risk difference and CI.
Expand Down
Loading

0 comments on commit ec8c413

Please sign in to comment.