Creates a publication-ready risk of bias assessment plot using gt tables, with options for single studies or subgroup analyses.
Usage
rob_plot(
data,
studyvar = NULL,
sort_studies_by = "author",
subgroup = FALSE,
sort_subgroup_by = "alphabetical",
rob_tool = c("rob2", "robins_i", "robins_e", "quadas2"),
add_rob_legend = FALSE,
font = NULL,
title = NULL,
title_align = "left",
subtitle = NULL
)Arguments
- data
A data frame containing risk of bias assessments with required columns: Author, Year, D1, D2, D3, and Overall. For subgroup analysis, a Subgroup column is also required.
- studyvar
Character string specifying the study identifier variable (currently not used).
- sort_studies_by
Character string specifying how to sort studies. Options: "author" (default), "year", or "effect".
- subgroup
Logical indicating whether to create a subgroup plot (default: FALSE).
- sort_subgroup_by
Character string or vector specifying subgroup ordering. Options: "alphabetical" (default) or a character vector of subgroup names in desired order.
- rob_tool
Character string specifying the risk of bias tool used. Options: "rob2" (default), "robins_i", "robins_e", or "quadas2".
- add_rob_legend
Logical indicating whether to add a legend explaining risk of bias symbols (default: FALSE).
- font
Character string specifying the font family to use for the plot.
- title
Character string for the plot title.
- title_align
Character string specifying title alignment. Options: "left" (default), "center"/"centre", or "right".
- subtitle
Character string for the plot subtitle.
Value
A gt table object (or patchwork composition if legend is added) containing the risk of bias plot.
Examples
if (FALSE) { # \dontrun{
# Create sample data
rob_data <- data.frame(
Author = c("Smith", "Jones", "Brown"),
Year = c(2020, 2021, 2022),
D1 = c("Low", "High", "Some concerns"),
D2 = c("Low", "Low", "High"),
D3 = c("Some concerns", "Low", "Low"),
Overall = c("Some concerns", "High", "High")
)
# Create basic risk of bias plot
rob_plot(rob_data)
# Create plot with legend and title
rob_plot(rob_data,
add_rob_legend = TRUE,
title = "Risk of Bias Assessment",
subtitle = "Using RoB 2 Tool")
} # }
