rt_plot: Plot transparency indicators

View source: R/rt_summary.R

rt_plotR Documentation

Plot transparency indicators

Description

Produces a 'ggplot' of either the prevalence of each indicator (a bar chart) or the prevalence over time (a line chart). Requires the 'ggplot2' package.

Usage

rt_plot(
  x,
  type = c("prevalence", "trend"),
  indicators = NULL,
  by = NULL,
  year = NULL,
  adjusted = FALSE,
  accuracy = NULL,
  conf_level = 0.95
)

Arguments

x

Either a data frame with one row per article (it is summarized with [rt_summary()]) or an existing [rt_summary()] result.

type

‘"prevalence"' for a bar chart of each indicator’s prevalence (the default), or '"trend"' for prevalence over time (requires 'year').

indicators, by

Passed to [rt_summary()] when 'x' is article-level data. 'by' adds facets to the '"prevalence"' plot.

year

For 'type = "trend"', the name of the column in 'x' holding the (numeric) publication year.

adjusted

If 'TRUE', plot the sensitivity/specificity-corrected prevalence instead of the apparent prevalence. Defaults to 'FALSE'.

accuracy, conf_level

Passed to [rt_summary()].

Value

A 'ggplot' object.

See Also

[rt_summary()]

Examples

data(rt_demo)

if (requireNamespace("ggplot2", quietly = TRUE)) {
  rt_plot(rt_demo)                          # prevalence bar chart
  rt_plot(rt_demo, type = "trend", year = "year")
}


rtransparency documentation built on July 1, 2026, 9:07 a.m.