Skip to content

Commit ceb70fc

Browse files
shajoezhuedelarua
andauthored
prep for rspm release 0.9.6, [skip vbump] (#1311)
close #1310 --------- Signed-off-by: Joe Zhu <joe.zhu@roche.com> Co-authored-by: Emily de la Rua <emily.de_la_rua@contractors.roche.com>
1 parent 533ac2b commit ceb70fc

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: tern
22
Title: Create Common TLGs Used in Clinical Trials
3-
Version: 0.9.5.9027
3+
Version: 0.9.6
44
Date: 2024-09-20
55
Authors@R: c(
66
person("Joe", "Zhu", , "joe.zhu@roche.com", role = c("aut", "cre")),
@@ -34,7 +34,7 @@ Imports:
3434
dplyr (>= 1.0.0),
3535
emmeans (>= 1.10.4),
3636
forcats (>= 1.0.0),
37-
formatters (>= 0.5.9),
37+
formatters (>= 0.5.8),
3838
ggplot2 (>= 3.5.0),
3939
grid,
4040
gridExtra (>= 2.0.0),

NEWS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# tern 0.9.5.9027
1+
# tern 0.9.6
2+
23
### Enhancements
34
* Added `errorbar_width` and `linetype` parameters to `g_lineplot`.
4-
* Reworking of `summarize_glm_count()` documentation and all its associated functions to better describe the results and the functions' purpose.
55
* Added the `.formats` argument to `tabulate_rsp_subgroups` and `tabulate_survival_subgroups` to allow users to specify formats.
66
* Added the `riskdiff` argument to `tabulate_rsp_subgroups` and `tabulate_survival_subgroups` to allow users to add a risk difference table column, and function `control_riskdiff` to specify settings for the risk difference column.
77
* Added warning to `tabulate_rsp_subgroups` when `pval` statistic is selected but `df` has not been correctly generated to add p-values to the output table.
88
* Added `n_rate` statistic as a non-default option to `estimate_incidence_rate` which returns both number of events observed and estimated incidence rate.
99
* Added `n_unique` statistic as a non-default option to `estimate_incidence_rate` which returns total number of patients with at least one event observed.
1010
* Refactored `estimate_incidence_rate` to work as both an analyze function and a summarize function, controlled by the added `summarize` parameter. When `summarize = TRUE`, labels can be fine-tuned via the new `label_fmt` argument to the same function.
1111
* Added `fraction` statistic to the `analyze_var_count` method group.
12+
* Improved `summarize_glm_count()` documentation and all its associated functions to better describe the results and the functions' purpose.
1213

1314
### Bug Fixes
14-
* Fixed a bug in `a_surv_time` that threw an error when split only has `"is_event"`.
1515
* Added defaults for `d_count_cumulative` parameters as described in the documentation.
16-
* Empty levels on `g_lineplot` x-axis are not shown in either plots.
16+
* Fixed a bug of empty levels on `g_lineplot` x-axis were not shown in either plots.
17+
* Fixed a bug in `a_surv_time` that threw an error when split only has `"is_event"`.
1718
* Fixed disappearing line in `g_lineplot` when using only one group or strata level.
1819
* Fixed defaults for formats and labels in `get_formats_from_stats` and `get_labels_from_stats`.
1920
* 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.

R/incidence_rate.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ s_incidence_rate <- function(df,
6363
id_var = "USUBJID",
6464
control = control_incidence_rate()) {
6565
if (lifecycle::is_present(is_event)) {
66+
checkmate::assert_string(is_event)
6667
lifecycle::deprecate_warn(
6768
"0.9.6", "s_incidence_rate(is_event)", "s_incidence_rate(n_events)"
6869
)
69-
n_events <- as.numeric(is_event)
70+
n_events <- is_event
71+
df[[n_events]] <- as.numeric(df[[is_event]])
7072
}
7173

7274
assert_df_with_variables(df, list(tte = .var, n_events = n_events))
@@ -76,7 +78,7 @@ s_incidence_rate <- function(df,
7678
checkmate::assert_numeric(df[[.var]], any.missing = FALSE)
7779
checkmate::assert_integerish(df[[n_events]], any.missing = FALSE)
7880

79-
n_unique <- n_available(unique(df[[id_var]][df$n_events == 1]))
81+
n_unique <- n_available(unique(df[[id_var]][df[[n_events]] == 1]))
8082
input_time_unit <- control$input_time_unit
8183
num_pt_year <- control$num_pt_year
8284
conf_level <- control$conf_level

R/riskdiff.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ afun_riskdiff <- function(df,
170170
#'
171171
#' @inheritParams add_riskdiff
172172
#' @param format (`string` or `function`)\cr the format label (string) or formatting function to apply to the risk
173-
#' difference statistic. See the `3d` string options in [list_valid_format_labels()] for possible format strings.
174-
#' Defaults to `"xx.x (xx.x - xx.x)"`.
173+
#' difference statistic. See the `3d` string options in [formatters::list_valid_format_labels()] for possible format
174+
#' strings. Defaults to `"xx.x (xx.x - xx.x)"`.
175175
#'
176176
#' @return A `list` of items with names corresponding to the arguments.
177177
#'

R/summarize_colvars.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#'
55
#' The analyze function [summarize_colvars()] uses the statistics function [s_summary()] to analyze variables that are
66
#' arranged in columns. The variables to analyze should be specified in the table layout via column splits (see
7-
#' [split_cols_by()] and [split_cols_by_multivar()]) prior to using [summarize_colvars()].
7+
#' [rtables::split_cols_by()] and [rtables::split_cols_by_multivar()]) prior to using [summarize_colvars()].
88
#'
99
#' The function is a minimal wrapper for [rtables::analyze_colvars()], a function typically used to apply different
1010
#' analysis methods in rows for each column variable. To use the analysis methods as column labels, please refer to

man/control_riskdiff.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/summarize_colvars.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/tables.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ knitr::opts_chunk$set(
2727

2828
The `tern` R package provides functions to create common analyses from clinical trials in `R`.
2929
The core functionality for tabulation is built on the more general purpose `rtables` package.
30-
New users should first begin by reading the ["Introduction to tern"](https://insightsengineering.github.io/tern/main/articles/tern.html) and ["Introduction to `rtables`"](https://insightsengineering.github.io/rtables/latest-tag/articles/introduction.html) vignettes.
30+
New users should first begin by reading the ["Introduction to tern"](https://insightsengineering.github.io/tern/main/articles/tern.html) and ["Introduction to `rtables`"](https://insightsengineering.github.io/rtables/latest-tag/articles/rtables.html) vignettes.
3131

3232
The packages used in this vignette are:
3333

vignettes/tern.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The `tern` R package contains analytical functions for creating tables and graph
3232
The main focus is on the clinical trial reporting tables but the graphs related to the clinical trials are also valuable.
3333
The core functionality for tabulation is built on top of the more general purpose `rtables` package.
3434

35-
[**It is strongly recommended that you start by reading the "Introduction to `rtables`" vignette to get familiar with the concept of `rtables`.**](https://insightsengineering.github.io/rtables/latest-tag/articles/introduction.html)
35+
[**It is strongly recommended that you start by reading the "Introduction to `rtables`" vignette to get familiar with the concept of `rtables`.**](https://insightsengineering.github.io/rtables/latest-tag/articles/rtables.html)
3636

3737
---------
3838

0 commit comments

Comments
 (0)