% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/heatplot.mvrank.R
\name{heatplot.mvrank}
\alias{heatplot.mvrank}
\title{A heatplot to visualize the ranking in a multivariate network meta-analysis}
\usage{
\method{heatplot}{mvrank}(
  x,
  sort = NULL,
  col.num = "white",
  num.size = 4.5,
  col.low = "lightblue",
  col.high = "darkblue",
  width.bar = 1.2,
  angle.x = 0,
  angle.y = 0,
  hjust.x = 0.5,
  hjust.y = 1,
  hjust.legend = 0.5,
  size.x = 8,
  size.y = 10,
  legend.position = "right",
  legend.direction = "vertical",
  ...
)
}
\arguments{
\item{x}{An object of class \code{\link{mvrank}}.}

\item{sort}{An optional argument to define an outcome to be used as a
reference when sorting the order of treatments on the x-axis.
If \code{NULL}, then the first outcome, as it appears in
\code{\link{mvrank}}, is used as the reference. The user can either
provide a single number corresponding to the position of the outcome in
the \code{\link{mvrank}} object or a character string with the name of
the outcome; can be abbreviated.}

\item{col.num}{The color of the numbers in the squares (default: "white").}

\item{num.size}{The size of the numbers in the squares (default: 4.5).}

\item{col.low}{The color for the low end of the gradient
(default: "lightblue").}

\item{col.high}{The color for the high end of the gradient
(default: "darkblue").}

\item{width.bar}{The width of the bars in the graph (default: 1.2).}

\item{angle.x}{The angle (in [0, 360]) to rotate the text appearing on
the x-axis (default: 0).}

\item{angle.y}{The angle (in [0, 360]) to rotate the text appearing on the
y-axis (default: 0).}

\item{hjust.x}{Horizontal justification for the text on the x-axis
(default: 0.5).}

\item{hjust.y}{Horizontal justification for the text on the y-axis
(default: 1).}

\item{hjust.legend}{Horizontal justification for the text in the legend
title (default: 0.5).}

\item{size.x}{Text size (in pts) on the x-axis (default: 8).}

\item{size.y}{Text size (in pts) on the y-axis (default: 10).}

\item{legend.position}{Position of the legend. Options are "top", "bottom",
"right" (default), and "left"; can be abbreviated.}

\item{legend.direction}{Direction of the legend. Options are "vertical"
(default) and "horizontal"; can be abbreviated.}

\item{\dots}{Additional arguments (ignored).}
}
\value{
A \code{ggplot} object.
}
\description{
This function produces a heatplot displaying the results of function
\code{\link{mvrank}}. The graph can be used to visualize the ranking output
when the method used to rank the treatments is either the surface under the
cumulative ranking curve (SUCRA) or the probability of best value (pBV).
}
\examples{
# Locate file "mvnma_examples.rda" with mvnma() results
.fname <- system.file("extdata/mvnma_examples.rda", package = "mvnma")
load(.fname)

# Rank the treatments
ranks_sucra <- mvrank(mvnma_all, 
  small.values = c("undes", "undes", "des", "des", "des"),
  method = "SUCRA")
ranks_sucra

# Create a heatplot sorting the results according to the first outcome
# (default), i.e., Early_Response
heatplot(ranks_sucra)

# Create a heatplot sorting the results according to the second outcome
# appearing in ranks_sucra (i.e Early_Remission)
heatplot(ranks_sucra, sort = 2)

# Create a heatplot sorting the results by explicitly mentioning the
# name of the outcome Early_Remission
heatplot(ranks_sucra, sort = "Early_Remission")

}
