Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix g_km unit conversion bug #1082

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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