diff --git a/DESCRIPTION b/DESCRIPTION index ad11bc09c5..0765012e79 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tern Title: Create Common TLGs Used in Clinical Trials -Version: 0.9.3.9035 +Version: 0.9.4 Date: 2024-04-16 Authors@R: c( person("Joe", "Zhu", , "joe.zhu@roche.com", role = c("aut", "cre")), @@ -25,7 +25,7 @@ URL: https://insightsengineering.github.io/tern/, BugReports: https://github.com/insightsengineering/tern/issues Depends: R (>= 3.6), - rtables (>= 0.6.6) + rtables (>= 0.6.7) Imports: broom (>= 0.5.4), car (>= 3.0-13), @@ -34,7 +34,7 @@ Imports: dplyr (>= 1.0.0), emmeans (>= 1.8.0), forcats (>= 1.0.0), - formatters (>= 0.5.5), + formatters (>= 0.5.6), ggplot2 (>= 3.5.0), grid, gridExtra (>= 2.0.0), diff --git a/NEWS.md b/NEWS.md index 8898da3e1f..42987a4171 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,12 +1,12 @@ -# tern 0.9.3.9035 +# tern 0.9.4 ### New Features -* Refactored `g_forest` to output a `ggplot` object instead of a `grob` object. * Added `h_glm_negbin` to `h_glm_count` to enable count data analysis using a negative binomial model. * Added argument `grade_groups_only` to `count_occurrences_by_grade` to allow users to only display rows for specified grade groups. * Added internal function `df2gg` that converts `data.frame` objects to `ggplot` objects. * Added functions `control_surv_med_annot` and `control_coxph_annot` to configure `g_km` annotation table sizes/positions. * Refactored `g_km` to output a `ggplot` object instead of a `grob` object. +* Refactored `g_forest` to output a `ggplot` object instead of a `grob` object. ### Enhancements * Default format for mean p-values (`mean_pval`) updated from `"xx.xx"` to `"x.xxxx | (<0.0001)"`. @@ -20,16 +20,16 @@ ### Miscellaneous * Added function `expect_snapshot_ggplot` to test setup file to process plot snapshot tests and allow plot dimensions to be set. -* Began deprecation of the named element `strat`, to be renamed to `strata`, within the `variables` argument to `h_rsp_to_logistic_variables`, `h_logistic_mult_cont_df`, `h_odds_ratio_subgroups_df`, `h_coxreg_mult_cont_df`, `h_coxph_subgroups_df`, `h_tbl_coxph_pairwise`, `extract_rsp_biomarkers`, `extract_rsp_subgroups`, `extract_survival_biomarkers`, and `extract_survival_subgroups`. -* Began deprecation of the `strat` argument to `s_coxph_pairwise` and replaced it with the `strata` argument. -* Adapt to argument renames introduced in `ggplot2` 3.5.0. +* Adapted to argument renames introduced in `ggplot2` 3.5.0. +* Renamed `individual_patient_plot.R` to `g_ipp.R`. * Removed all instances of deprecated parameters `time_unit_input`, `time_unit_output`, `na_level` and `indent_mod`. * Removed deprecated functions `summarize_vars`, `control_summarize_vars`, `a_compare`, `create_afun_summary`, `create_afun_compare`, and `summary_custom`. +* Removed `vdiffr` package from Suggests in DESCRIPTION file. +* Began deprecation of the named element `strat`, to be renamed to `strata`, within the `variables` argument to `h_rsp_to_logistic_variables`, `h_logistic_mult_cont_df`, `h_odds_ratio_subgroups_df`, `h_coxreg_mult_cont_df`, `h_coxph_subgroups_df`, `h_tbl_coxph_pairwise`, `extract_rsp_biomarkers`, `extract_rsp_subgroups`, `extract_survival_biomarkers`, and `extract_survival_subgroups`. +* Began deprecation of the `strat` argument to `s_coxph_pairwise` and replaced it with the `strata` argument. * Began deprecation of the `forest_grob`, `forest_dot_line`, `forest_viewport`, `vp_forest_table_part`, and `grid.forest` functions. * Began deprecation of no longer used Kaplan-Meier helper functions `h_ggkm`, `h_decompose_gg`, `h_km_layout`, `h_grob_tbl_at_risk`, `h_grob_median_surv`, `h_grob_y_annot`, and `h_grob_coxph`. * Began deprecation of `grob`/`grid` related functions `stack_grobs`, `arrange_grobs`, and `draw_grob` which are no longer used in `tern`. -* Removed `vdiffr` package from Suggests in DESCRIPTION file. -* Renamed `individual_patient_plot.R` to `g_ipp.R`. # tern 0.9.3 diff --git a/R/utils_ggplot.R b/R/utils_ggplot.R index 2b69a38b9c..27a1e65fb4 100644 --- a/R/utils_ggplot.R +++ b/R/utils_ggplot.R @@ -136,14 +136,14 @@ rtable2gg <- function(tbl, fontsize = 12, colwidths = NULL, lbl_col_padding = 0) #' Given a `data.frame` object, performs basic conversion to a [ggplot2::ggplot()] object built using #' functions from the `ggplot2` package. #' -#' @param tbl (`data.frame`)\cr a data frame. +#' @param df (`data.frame`)\cr a data frame. #' @param colwidths (`numeric` or `NULL`)\cr a vector of column widths. Each element's position in #' `colwidths` corresponds to the column of `df` in the same position. If `NULL`, column widths #' are calculated according to maximum number of characters per column. #' @param font_size (`numeric(1)`)\cr font size. #' @param col_labels (`flag`)\cr whether the column names (labels) of `df` should be used as the first row #' of the output table. -#' @param col_labels_fontface (`string`)\cr font face to apply to the first row (of column labels +#' @param col_lab_fontface (`string`)\cr font face to apply to the first row (of column labels #' if `col_labels = TRUE`). Defaults to `"bold"`. #' @param hline (`flag`)\cr whether a horizontal line should be printed below the first row of the table. #' @param bg_fill (`string`)\cr table background fill color. diff --git a/README.md b/README.md index 730aa4c0ce..9f37858892 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Data visualizations: Statistical model fit summaries: -- Logistic regression ([`summarize_logistic`](https://insightsengineering.github.io/tern/latest-tag/reference/logistic_regression.html)) +- Logistic regression ([`summarize_logistic`](https://insightsengineering.github.io/tern/latest-tag/reference/summarize_logistic.html)) - Cox regression ([`summarize_coxreg`](https://insightsengineering.github.io/tern/latest-tag/reference/cox_regression.html)) Analysis tables: diff --git a/man/df2gg.Rd b/man/df2gg.Rd index f14dff9e3f..0680270103 100644 --- a/man/df2gg.Rd +++ b/man/df2gg.Rd @@ -15,6 +15,8 @@ df2gg( ) } \arguments{ +\item{df}{(\code{data.frame})\cr a data frame.} + \item{colwidths}{(\code{numeric} or \code{NULL})\cr a vector of column widths. Each element's position in \code{colwidths} corresponds to the column of \code{df} in the same position. If \code{NULL}, column widths are calculated according to maximum number of characters per column.} @@ -24,14 +26,12 @@ are calculated according to maximum number of characters per column.} \item{col_labels}{(\code{flag})\cr whether the column names (labels) of \code{df} should be used as the first row of the output table.} +\item{col_lab_fontface}{(\code{string})\cr font face to apply to the first row (of column labels +if \code{col_labels = TRUE}). Defaults to \code{"bold"}.} + \item{hline}{(\code{flag})\cr whether a horizontal line should be printed below the first row of the table.} \item{bg_fill}{(\code{string})\cr table background fill color.} - -\item{tbl}{(\code{data.frame})\cr a data frame.} - -\item{col_labels_fontface}{(\code{string})\cr font face to apply to the first row (of column labels -if \code{col_labels = TRUE}). Defaults to \code{"bold"}.} } \value{ A \code{ggplot} object.