I am creating a subgroup analyses forest plot with forestplot in R.
Here is the code snippet:
tm_new <- forest_theme(
base_size = 10,
ci_pch = 15,
ci_col = "#762a83",
ci_fill = "black",
ci_alpha = 0.8,
ci_lty = 1,
ci_lwd = 1.5,
ci_Theight = 0.2,
refline_lwd = gpar(lwd = 1, lty = "dashed", col = "grey20"),
vertline_lwd = 1,
vertline_lty = "dashed",
vertline_col = "grey20",
summary_fill = "#4575b4",
summary_col = "#4575b4",
summary_cex = 2
)
labeltext <- as.matrix(os_all[, c("Subgroup3", "HR (95% CI)", "space")])
forestplot(
labeltext,
mean = os_all$est3,
lower = os_all$low3,
upper = os_all$hi3,
is.summary = c(rep(FALSE, nrow(os_all)-1), TRUE),
ci.vertices = TRUE,
clip = c(0, 4),
xlab = "Hazard Ratio (95% CI)",
xticks = c(0.5, 1, 2, 3),
txt_gp = fpTxtGp(label = gpar(fontfamily = "", cex = 1),
ticks = gpar(cex = 1),
xlab = gpar(cex = 1.2)),
col = fpColors(box = "darkblue", lines = "darkblue", zero = "black"),
lwd.ci = 2,
boxsize = 0.2,
ci.vertices.height = 0.2,
colgap = unit(6, "mm"),
theme = tm_new
)
How can I add a dashed reference line at HR 1?
I tried adding the refline argument but it did not work