Content-Length: 250398 | pFad | http://github.com/umg-minai/crt/commit/48312071edbd45b6a2ce0d37f2e2c58082a0845b

D2 feat: add x-axis labels to forest plots · umg-minai/crt@4831207 · GitHub
Skip to content

Commit

Permalink
feat: add x-axis labels to forest plots
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Nov 30, 2023
1 parent f8f3835 commit 4831207
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sections/10-figures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ plot_table(
```{r ggforest-mod, include = FALSE}
## taken from survminer::ggforest, added rename argument to change labels
.ggforest <- function(model, data = NULL,
main = "Hazard ratio", cpositions=c(0.02, 0.22, 0.4),
main = "Hazard ratio of CRT", cpositions=c(0.02, 0.22, 0.4),
labpos = c(0.5, 2),
fontsize = 0.7, refLabel = "reference", noDigits=2,
rename = NULL) {
conf.high <- conf.low <- estimate <- NULL
Expand Down Expand Up @@ -379,7 +380,9 @@ plot_table(
label = paste0("# Events: ", gmodel$nevent, "; Global p-value (Log-Rank): ",
format.pval(gmodel$p.value.log, eps = ".001"), " \nAIC: ", round(gmodel$AIC,2),
"; Concordance Index: ", round(gmodel$concordance,2)),
size = annot_size_mm, hjust = 0, vjust = 1.2, fontface = "italic")
size = annot_size_mm, hjust = 0, vjust = 1.2, fontface = "italic") +
annotate(geom = "text", x = 0, y = labpos[1], label = "Favours CRT-free") +
annotate(geom = "text", x = 0, y = labpos[2], label = "Favours CRT")
# switch off clipping for p-vals, bottom annotation:
gt <- ggplot_gtable(ggplot_build(p))
gt$layout$clip[gt$layout$name == "panel"] <- "off"
Expand Down
1 change: 1 addition & 0 deletions sections/11-supplement.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ tbl_regression(rgcx.full, exponentiate = TRUE) |>
.ggforest(
rgcx.full,
data = rd.na,
labpos = c(0.1, 10),
rename = c(
ManLu = "Type",
Attempts2 = "More than one attempt",
Expand Down

0 comments on commit 4831207

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/umg-minai/crt/commit/48312071edbd45b6a2ce0d37f2e2c58082a0845b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy