Skip to content

Commit

Permalink
Fix g_km unit conversion bug (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua authored Oct 12, 2023
1 parent 07761c9 commit 493fede
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* Added formatting function `format_count_fraction_lt10` for formatting `count_fraction` with special consideration when count is less than 10.
* Updated `s_summary.logical` output for `count_fraction` when denominator is zero to display as `NA` instead of `0` in tables.

### Bug Fixes
* Fixed bug in `g_km` causing an error when converting certain annotation width units.

### Miscellaneous
* Began deprecation of `na_level` argument in `s_count_abnormal_by_baseline`, `a_summary`, `analyze_vars`, `analyze_vars_in_cols`, `compare_vars`, `h_map_for_count_abnormal`, `h_stack_by_baskets`, `summarize_colvars`, `a_coxreg`, and `summarize_coxreg` and replaced it with the `na_str` argument.

Expand Down
4 changes: 2 additions & 2 deletions R/kaplan_meier_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ h_grob_median_surv <- function(fit_km,
ttheme = gridExtra::ttheme_default()) {
data <- h_tbl_median_surv(fit_km, armval = armval)

width <- grid::convertUnit(width, "in")
width <- grid::convertUnit(grid::unit(as.numeric(width), grid::unitType(width)), "in")
height <- width * (nrow(data) + 1) / 12

w <- paste(" ", c(
Expand Down Expand Up @@ -1425,7 +1425,7 @@ h_grob_coxph <- function(...,
)) {
data <- h_tbl_coxph_pairwise(...)

width <- grid::convertUnit(width, "in")
width <- grid::convertUnit(grid::unit(as.numeric(width), grid::unitType(width)), "in")
height <- width * (nrow(data) + 1) / 12

w <- paste(" ", c(
Expand Down

0 comments on commit 493fede

Please sign in to comment.