Skip to content

Commit

Permalink
Merge branch 'main' into 1121_lbls_fmts_utilities@main
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua authored Nov 6, 2023
2 parents a27338a + 58f6b68 commit 2760b64
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 264 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tern
Title: Create Common TLGs Used in Clinical Trials
Version: 0.9.2.9007
Date: 2023-11-02
Version: 0.9.2.9008
Date: 2023-11-06
Authors@R: c(
person("Joe", "Zhu", , "[email protected]", role = c("aut", "cre")),
person("Daniel", "Sabanés Bové", , "[email protected]", role = "aut"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tern 0.9.2.9007
# tern 0.9.2.9008

### New Features
* Added `ref_group_position` function to place the reference group facet last, first or at a certain position.
Expand All @@ -11,6 +11,7 @@
### Enhancements
* Added `ref_group_coxph` parameter to `g_km` to specify the reference group used for pairwise Cox-PH calculations when `annot_coxph = TRUE`.
* Added `annot_coxph_ref_lbls` parameter to `g_km` to enable printing the reference group in table labels when `annot_coxph = TRUE`.
* Added `x_lab` parameter to `g_lineplot` to customize x-axis label.

### Miscellaneous
* Specified minimal version of package dependencies.
Expand Down
4 changes: 3 additions & 1 deletion R/g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#' @param legend_position (`character`)\cr the position of the plot legend (`none`, `left`, `right`, `bottom`, `top`,
#' or two-element numeric vector).
#' @param ggtheme (`theme`)\cr a graphical theme as provided by `ggplot2` to control styling of the plot.
#' @param x_lab (`character`)\cr x-axis label. If equal to `NULL`, then no label will be added.
#' @param y_lab (`character`)\cr y-axis label. If equal to `NULL`, then no label will be added.
#' @param y_lab_add_paramcd (`logical`)\cr should `paramcd`, i.e. `unique(df[[variables["paramcd"]]])` be added to the
#' y-axis label `y_lab`?
Expand Down Expand Up @@ -137,6 +138,7 @@ g_lineplot <- function(df,
legend_title = NULL,
legend_position = "bottom",
ggtheme = nestcolor::theme_nest(),
x_lab = obj_label(df[[variables[["x"]]]]),
y_lab = NULL,
y_lab_add_paramcd = TRUE,
y_lab_add_unit = TRUE,
Expand Down Expand Up @@ -330,7 +332,7 @@ g_lineplot <- function(df,
color = legend_title,
lty = legend_title,
shape = legend_title,
x = attr(df[[x]], "label"),
x = x_lab,
y = y_lab
)

Expand Down
3 changes: 3 additions & 0 deletions man/g_lineplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

158 changes: 0 additions & 158 deletions tests/testthat/_snaps/g_km/grob-tmp-char.svg

This file was deleted.

205 changes: 103 additions & 102 deletions tests/testthat/_snaps/g_lineplot/g-lineplot-w-stats.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/testthat/test-g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ testthat::test_that("g_lineplot works with custom settings and statistics table"
table = c("n", "mean", "mean_ci"),
control = control_analyze_vars(conf_level = 0.80),
title = "Plot of Mean and 80% Confidence Limits by Visit",
x_lab = "Time",
y_lab = "Lab Test",
subtitle = "Laboratory Test:",
caption = "caption"
Expand Down

0 comments on commit 2760b64

Please sign in to comment.