% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot_weightfunction}
\alias{plot_weightfunction}
\alias{plot_weightfunction.brma}
\title{Plots Weight Function of brma Object}
\usage{
plot_weightfunction(x, ...)

\method{plot_weightfunction}{brma}(
  x,
  rescale_p_values = TRUE,
  prior = FALSE,
  plot_type = "base",
  show_data = TRUE,
  dots_data = NULL,
  dots_prior = NULL,
  ...
)
}
\arguments{
\item{x}{a fitted \code{brma} object with a weightfunction/selection
component, such as \code{bselmodel()} or a \code{RoBMA()} object with
weightfunction priors.}

\item{...}{list of additional graphical arguments
to be passed to the plotting function. Supported arguments
are \code{lwd}, \code{lty}, \code{col}, \code{col.fill},
\code{xlab}, \code{ylab}, \code{main}, \code{xlim}, \code{ylim}
to adjust the line thickness, line type, line color, fill color,
x-label, y-label, title, x-axis range, and y-axis range
respectively.}

\item{rescale_p_values}{whether to rescale p-values to the interval shown
by the weightfunction plot. Defaults to \code{TRUE}.}

\item{prior}{whether prior distribution should be added to
figure. Defaults to \code{FALSE}.}

\item{plot_type}{whether to use a base plot \code{"base"}
or ggplot2 \code{"ggplot"} for plotting. Defaults to
\code{"base"}.}

\item{show_data}{whether observed one-sided p-values should be shown as rug
marks on the weightfunction axis. Defaults to \code{TRUE}.}

\item{dots_data}{list of additional graphical arguments for observed
p-value rug marks. Supported arguments include \code{col}/\code{color},
\code{alpha}, \code{lwd}/\code{linewidth}/\code{size},
\code{side}/\code{rug_side}, and
\code{height}/\code{rug_height}/\code{ticksize}.}

\item{dots_prior}{list of additional graphical arguments
to be passed to the plotting function of the prior
distribution. Supported arguments are \code{lwd},
\code{lty}, \code{col}, and \code{col.fill}, to adjust
the line thickness, line type, line color, and fill color
of the prior distribution respectively.}
}
\value{
\code{plot_weightfunction.brma} returns either \code{NULL} if
\code{plot_type = "base"} or a \code{ggplot2} object if
\code{plot_type = "ggplot"}.
The method errors for fitted objects without a weightfunction component.
}
\description{
\code{plot_weightfunction.brma} visualizes the posterior
(and optionally prior) publication-bias weight function of a brma object.
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")
  fit <- bselmodel(
    yi      = yi,
    vi      = vi,
    data    = dat.lehmann2018,
    measure = "SMD",
    seed    = 1,
    silent  = TRUE
  )

  plot_weightfunction(fit)
  plot_weightfunction(fit, prior = TRUE)
}
}


}
\seealso{
\code{\link[=RoBMA]{RoBMA()}}
}
