# NOT RUN {
## Stroke prevention in atrial fibrillation
# Setting up the network
af_net <- set_agd_arm(atrial_fibrillation,
study = studyc,
trt = abbreviate(trtc, minlength = 3),
r = r,
n = n,
trt_class = trt_class)
af_net
# Basic plot
plot(af_net)
# Turn off weighting edges by number of studies
plot(af_net, weight_edges = FALSE)
# Turn on weighting nodes by sample size
plot(af_net, weight_nodes = TRUE)
# Colour treatment nodes by class
plot(af_net, weight_nodes = TRUE, show_trt_class = TRUE)
# Output may be customised using standard ggplot commands
# For example, to display the legends below the plot:
plot(af_net, weight_nodes = TRUE, show_trt_class = TRUE) +
ggplot2::theme(legend.position = "bottom",
legend.box = "vertical",
legend.margin = ggplot2::margin(0, 0, 0, 0),
legend.spacing = ggplot2::unit(0.5, "lines"))
# Choosing a different ggraph layout, hiding some legends
plot(af_net, weight_nodes = TRUE, show_trt_class = TRUE,
layout = "star") +
ggplot2::guides(edge_width = "none", size = "none")
# }
Run the code above in your browser using DataLab