Skip to content

Commit

Permalink
rename trans to transform (insightsengineering#1202)
Browse files Browse the repository at this point in the history
when working on tlg-catalog I have found a lifecycle warning coming out
of `tern`

```
[141/144] graphs/efficacy/mmrmg02.qmd

processing file: mmrmg02.qmd
1/20                  
2/20 [knitr_utils]    
3/20                  
4/20 [setup]          
5/20                  
6/20 [unnamed-chunk-1]
7/20                  
8/20 [plot1]          

Quitting from lines 84-105 [plot1] (mmrmg02.qmd)
Error:
! The `trans` argument of `continuous_scale()` is deprecated as of
  ggplot2 3.5.0.
ℹ Please use the `transform` argument instead.
Backtrace:
 1. tern::g_forest(...)
 2. ggplot2::scale_x_continuous(...)
 3. ggplot2::continuous_scale(...)
 4. ggplot2:::deprecate_soft0(...)
 5. lifecycle::deprecate_soft(..., user_env = user_env)
 6. lifecycle:::deprecate_stop0(msg)
```
  • Loading branch information
pawelru committed Mar 11, 2024
1 parent 6ce9fb5 commit 796663e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Imports:
emmeans (>= 1.8.0),
forcats (>= 1.0.0),
formatters (>= 0.5.5),
ggplot2 (>= 3.4.0),
ggplot2 (>= 3.5.0),
grid,
gridExtra (>= 2.0.0),
gtable (>= 0.3.0),
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* 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.

# tern 0.9.3

Expand All @@ -25,14 +26,14 @@
* Added `keep_level_order` split function to retain original order of levels in a split.
* Added `level_order` split function to reorder manually the levels.
* Added function `get_indents_from_stats` to format and return indent modifiers for a given set of statistics.
* Added internal utility function `apply_auto_formatting` to check for `"auto"` formats and replace them with
* Added internal utility function `apply_auto_formatting` to check for `"auto"` formats and replace them with
implementation of `format_auto` in analyze functions.
* Added utility function `labels_use_control` to modify labels with control specifications.
* Added list containing default statistics for each method group, `tern_default_stats`.
* Added summarize function version of `count_occurrences` analyze function, `summarize_occurrences`.
* Added referential footnotes to `surv_time` for censored range observations, controlled via the `ref_fn_censor` parameter.
* Added helper function `h_adlb_abnormal_by_worst_grade` to prepare `ADLB` data to use as input in `count_abnormal_by_worst_grade`.
* Added `s_bland_altman` function to assess agreement between two numerical vectors.
* Added `s_bland_altman` function to assess agreement between two numerical vectors.
* Added function `rtable2gg` that converts `rtable` objects to `ggplot` objects.
* Added helper function to set default `na_str` globally with `set_default_na_str()` and added `default_na_str()` for all interested functions.

Expand Down
2 changes: 1 addition & 1 deletion R/g_forest.R
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ g_forest <- function(tbl,
plot.margin = margin(0, 0.1, 0.05, 0, "npc")
) +
scale_x_continuous(
trans = ifelse(logx, "log", "identity"),
transform = ifelse(logx, "log", "identity"),
limits = xlim,
breaks = x_at,
labels = x_labels,
Expand Down

0 comments on commit 796663e

Please sign in to comment.