Skip to content

Commit

Permalink
rework docs summarize_glm_count (#1269)
Browse files Browse the repository at this point in the history
Fixes #1268

---------

Signed-off-by: Davide Garolini <dgarolini@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Abinaya Yogasekaram <73252787+ayogasekaram@users.noreply.github.com>
Co-authored-by: b_falquet <64274616+BFalquet@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
5 people authored Jul 23, 2024
1 parent 4ac1c78 commit f9e78db
Show file tree
Hide file tree
Showing 11 changed files with 429 additions and 352 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export(h_or_cat_interaction)
export(h_or_cont_interaction)
export(h_or_interaction)
export(h_pkparam_sort)
export(h_ppmeans)
export(h_proportion_df)
export(h_proportion_subgroups_df)
export(h_row_counts)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# tern 0.9.5.9006
### Enhancements
* Added `errorbar_width` and `linetype` parameters to `g_lineplot`.
* Reworking of `summarize_glm_count()` documentation and all its associated functions to better describe the results and the functions' purpose.

### Bug Fixes
* Fixed a bug in `a_surv_time` that threw an error when split only has `"is_event"`.
* Added defaults for `d_count_cumulative` parameters as described in the documentation.
* Empty levels on `g_lineplot` x-axis are not shown in either plots.
* Fixed disappearing line in `g_lineplot` when using only one group or strata level.
* Fixed defaults for formats and labels in `get_formats_from_stats` and `get_labels_from_stats`.
* Fixed bug for linear scaling factor (`scale` parameter) being applied to response but not to rate in `h_glm_count` while all distributions have logarithmic link function.

### Miscellaneous
* Began deprecation of the confusing functions `summary_formats` and `summary_labels`.

# tern 0.9.5

Expand Down
15 changes: 11 additions & 4 deletions R/g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ g_lineplot <- function(df,
subtitle_add_paramcd = TRUE,
subtitle_add_unit = TRUE,
caption = NULL,
table_format = get_formats_from_stats(table),
table_labels = get_labels_from_stats(table),
table_format = NULL,
table_labels = NULL,
table_font_size = 3,
errorbar_width = 0.45,
newpage = lifecycle::deprecated(),
Expand All @@ -176,9 +176,16 @@ g_lineplot <- function(df,
checkmate::assert_string(title, null.ok = TRUE)
checkmate::assert_string(subtitle, null.ok = TRUE)

if (!is.null(table)) {
table_format <- get_formats_from_stats(table)
table_labels <- get_labels_from_stats(table)
}

extra_args <- list(...)
if ("control" %in% names(extra_args) && all(table_labels == get_labels_from_stats(table))) {
table_labels <- table_labels %>% labels_use_control(extra_args[["control"]])
if ("control" %in% names(extra_args)) {
if (!is.null(table) && all(table_labels == get_labels_from_stats(table))) {
table_labels <- table_labels %>% labels_use_control(extra_args[["control"]])
}
}

if (is.character(interval)) {
Expand Down
Loading

0 comments on commit f9e78db

Please sign in to comment.