<- data.frame(
my_results risk_factor = c( 17, 20, 23.5, 25, 29),
est = c( 0, 0.069, 0.095, 0.182, 0.214),
se = c(0.05, 0.048, 0.045, 0.045, 0.081)
)
shape_plot(my_results,
col.x = "risk_factor",
xlims = c(15, 30),
ylims = c(-0.25, 0.5),
addaes = list(estimates = "label = NA"))
Removing parts of a plot created with shape_plot()
or forest_plot()
ckbplotr
There are various ways to remove parts of plots (or make them not appear) created with shape_plot()
and forest_plot()
. Which will work best may depend on how you are using the code, some examples are:
Remove text by setting label to NA
You could also set x
or y
to NA_real_
.
Remove points by setting their colour to NA
<- data.frame(
my_results subgroup = c("men", "women", "35_49", "50_64", "65_79"),
est = c( 0.45, 0.58, 0.09, 0.35, 0.6),
se = c( 0.07, 0.06, 0.06, 0.05, 0.08)
)
forest_plot(my_results,
colour = NA,
cicolour = "black")
Remove points by setting their size to zero
forest_plot(my_results,
pointsize = 0)
Remove confidence interval lines by setting their colour to NA
forest_plot(my_results,
cicolour = NA)
Remove points by removing that layer of the ggplot object
<- forest_plot(my_results,
forest printplot = FALSE)
## first check which layer in forest$plot
## is the geom_point() for points, then remove
$plot$layers[[2]] <- NULL
forest$plot forest