View source: R/autoplot_pfun.R
| autoplot.confMeta | R Documentation |
confMeta objectsPlots one or more confMeta objects. This function can
create two types of plots: the p-value function plot (also known
as drapery plot) and the forest plot. This allows for direct visual
comparison of different p-value functions.
Optionally, a Bayesian meta-analysis object created with the
bayesmeta::bayesmeta() function can be supplied via the bayesmeta argument.
When provided, its posterior summary is displayed as an additional diamond
at the bottom of the forest plot for comparison with the frequentist methods
Important Note: If supplying a Bayesian meta-analysis object
via the bayesmeta argument, this function explicitly extracts the
95% credible intervals. If the Bayesian model was fit using a different
credible level, the function will crash.
## S3 method for class 'confMeta'
autoplot(
...,
type = c("p", "forest"),
diamond_height = 0.5,
v_space = 1.5,
scale_diamonds = TRUE,
show_studies = TRUE,
drapery = TRUE,
reference_methods_p = c("re"),
reference_methods_forest = c("re", "hk", "hc"),
ref_labels = NULL,
xlim = NULL,
xlim_p = NULL,
xlim_forest = NULL,
same_xlim = TRUE,
xlab = NULL,
n_breaks = 7,
bayesmeta = NULL,
n_points = 1000
)
... |
One or more objects of class |
type |
A character vector of length 1 or 2. Indicates what type of
plot should be returned. Accepted values are |
diamond_height |
Numeric scalar. Indicates the maximal
possible height of the diamonds in the forest plot. Defaults to 0.5.
This argument is only relevant if |
v_space |
Numeric scalar. Indicates the vertical space
between two diamonds in the forest plot. Defaults to 1.5.
This argument is only relevant if |
scale_diamonds |
Logical. If |
show_studies |
Logical. If |
drapery |
Logical. If |
reference_methods_p |
Character vector controlling which reference
meta-analysis methods are shown as baseline curves in the
p-value function plot. Valid options are |
reference_methods_forest |
Character vector of length 1 to 4.
Specifies which reference meta-analysis methods should be shown as
diamonds in the forest plot. Valid options are any subset of
Defaults to |
ref_labels |
A named character vector to customize the labels of the reference
methods in the plot legends and axes (e.g., |
xlim |
Numeric vector of length 2. Global limits for the x-axis.
If |
xlim_p |
Numeric vector of length 2. Specific x-axis limits for the
p-value plot. Overrides |
xlim_forest |
Numeric vector of length 2. Specific x-axis limits for
the forest plot. Overrides |
same_xlim |
Logical. If |
xlab |
Character string. Label for the x-axis. Defaults to |
n_breaks |
Numeric. Approximate number of tick marks to display on the x-axis. Defaults to 7. |
bayesmeta |
An object of class |
n_points |
Numeric. Number of points used to create the p-value plot. Higher values (e.g., 10000) yield higher resolution but take longer to render. Defaults to 1000. |
An object of class ggplot containing the specified plot(s).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.