Create a forest plot for simple data
forester(
data,
display_cols = c("Variable", "HR", "lower_95", "upper_95"),
estimate_precision = 2,
null_line_at = 1,
font_family = "mono",
x_scale_linear = TRUE,
xlim = NULL,
xbreaks = NULL,
point_sizes = 3,
point_shape = 16,
label_hjust = 0,
label_vjust = -1,
label_color = "blue",
label_size = 3
)
Data frame (required). The information to be displayed as the forest plot.
4 columns stand for axis text and the forest data,
default using c("term", "HR", "conf.low", "conf.high")
.
Integer. The number of decimal places on the estimate (default 2).
Numeric. Default 0. Change to 1 if using relative measures such as OR, RR.
String. The font to use for the ggplot. Default "mono".
Logical. Default TRUE, change to FALSE for log scale
Vector. Manually specify limits for the x axis as a vector length 2, i.e. c(low, high)
Vector. X axis breaks to label. Specify limits in xlim if using this option.
Vector. Length should be equal to 1 or nrow(left_side_data). The sizes of the points in the center plot, where 3.25 is the default.
Vector. Length should be equal to 1 or nrow(left_side_data). The shapes of the points in the center plot, where 16 (a filled circle) is the default.
hjust, vjust color and size for the label text.
a ggplot
object.
library(survival)
t1 <- ezcox(lung, covariates = c(
"age", "sex",
"ph.karno", "pat.karno"
))
#> => Processing variable age
#> ==> Building Surv object...
#> ==> Building Cox model...
#> ==> Done.
#> => Processing variable sex
#> ==> Building Surv object...
#> ==> Building Cox model...
#> ==> Done.
#> => Processing variable ph.karno
#> ==> Building Surv object...
#> ==> Building Cox model...
#> ==> Done.
#> => Processing variable pat.karno
#> ==> Building Surv object...
#> ==> Building Cox model...
#> ==> Done.
p <- forester(t1, xlim = c(0, 1.5))
p
p2 <- forester(t1, xlim = c(0.5, 1.5))
p2