Skip to content

Commit 21281c4

Browse files
MouksassiMouksassi
authored andcommitted
refresh docs based on ggplot2 3.5.2
added fixes to ggkmrisktable to reflect color factor ordering for medians, and add omited show exptile values textsize. change NA from median surivvail to -
1 parent ffd0bc3 commit 21281c4

File tree

9 files changed

+25
-31
lines changed

9 files changed

+25
-31
lines changed

R/ggkmrisktable.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,11 @@ ggkmrisktable <- function(data = lung_long, # long format filter to Endpoint of
589589
for(variable in variables) {
590590
dfmedian[[variable]] <- .get_variable_value(variable, dfmedian$strata, surv_object, data.long)
591591
}
592+
if (!is.null( levels(data.long[[colorinputvar]]))){
593+
collevels <- levels(data.long[[colorinputvar]])
594+
dfmedian[[colorinputvar]] <- factor(dfmedian[[colorinputvar]],
595+
levels = collevels)
596+
}
592597
}
593598
}
594599

@@ -656,7 +661,7 @@ ggkmrisktable <- function(data = lung_long, # long format filter to Endpoint of
656661
"{statusvar}" := NA),
657662
ggplot2::aes( x = km_median_table_pos_x, y = 0.09*rev(as.numeric(as.factor(get(!!color_fill)))),
658663
label = paste0(get(!!color_fill), ": ",
659-
sprintf("%#.3g (%#.3g, %#.3g)",x1,x1lower,x1upper)
664+
gsub("NA","-",sprintf("%#.3g (%#.3g, %#.3g)",x1,x1lower,x1upper))
660665
)),
661666
hjust = km_median_table_pos_hjust,
662667
show.legend = FALSE,inherit.aes = TRUE)
@@ -670,7 +675,7 @@ ggkmrisktable <- function(data = lung_long, # long format filter to Endpoint of
670675
"{statusvar}" := NA),
671676
ggplot2::aes( x = km_median_table_pos_x, y = 0.09*(as.numeric(as.factor(get(!!color_fill)))),
672677
label = paste0(get(!!color_fill), ": ",
673-
sprintf("%#.3g (%#.3g, %#.3g)",x1,x1lower,x1upper)
678+
gsub("NA","-",sprintf("%#.3g (%#.3g, %#.3g)",x1,x1lower,x1upper))
674679
)),
675680
hjust = km_median_table_pos_hjust,
676681
show.legend = FALSE,inherit.aes = TRUE)
@@ -750,6 +755,7 @@ ggkmrisktable <- function(data = lung_long, # long format filter to Endpoint of
750755
label = paste0(exptile, ": ",exprange
751756
)),
752757
hjust = exptile_values_pos_x_hjust,
758+
size = show_exptile_values_textsize,
753759
show.legend = FALSE,inherit.aes = TRUE)
754760
}
755761

R/gglogisticexpdist.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ plogis <- function(x) exp(x)/(1+exp(x))
6565
#' @param Nresp_Ntot_size N responders/Ntotal text size default to 5
6666
#' @param Nresp_Ntot_ypos y position for N responders/Ntotal two text elements the first for by exptile and the second
6767
#' for by dose/color options include `with percentages` `top` `bottom`
68-
#' @param Nresp_Ntot_sep character string to separat N responders/ Ntotal default `/`
68+
#' @param Nresp_Ntot_sep character string to separate N responders/ Ntotal default `/`
6969
#' @param binlimits_show show the binlimits vertical lines `TRUE`/`FALSE`
7070
#' @param binlimits_text_size binlimits text size default to 5
7171
#' @param binlimits_ypos binlimits y position default to 0

man/geom_km.Rd

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_kmband.Rd

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_kmticks.Rd

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/gglogisticexpdist.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/stat_km.Rd

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/stat_kmband.Rd

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/stat_kmticks.Rd

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)