% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ggInterval_2Dhist.R
\name{ggInterval_2Dhist}
\alias{ggInterval_2Dhist}
\title{Visualize a 2-dimension histogram for interval-valued data}
\usage{
ggInterval_2Dhist(data = NULL, mapping = aes(NULL),
method = "equal-bin", xBins = 14, yBins = 16,
display = "p", palette = "Blues", direction = 1, tau = 0,
removeZero = FALSE, cell_labels = FALSE, label_rule = "above-mean",
addFreq = NULL)
}
\arguments{
\item{data}{A ggInterval object. It can also be either an RSDA object or
a classical data frame, which will be automatically converted to
ggInterval data.}

\item{mapping}{Set of aesthetic mappings created by aes() or aes_().
If specified and inherit.aes = TRUE (the default), it is combined with
the default mapping at the top level of the plot. You must supply
mapping if there is no plot mapping. It is the same as the mapping of
ggplot2.}

\item{method}{Histogram partition method. Use \code{"equal-bin"} for
equally spaced bins or \code{"unequal-bin"} for non-equidistant bins
defined by the observed interval endpoints.}

\item{xBins}{Number of x-axis bins used when \code{method = "equal-bin"}.}

\item{yBins}{Number of y-axis bins used when \code{method = "equal-bin"}.}

\item{display}{Metric shown in the cells. Use \code{"p"} for relative
frequency, \code{"f"} for weighted frequency, or \code{"h"} for density.}

\item{palette}{ColorBrewer palette passed to \code{scale_fill_distiller()}.}

\item{direction}{Direction passed to \code{scale_fill_distiller()}.}

\item{tau}{Non-negative tolerance used when \code{method = "unequal-bin"}.
Consecutive breakpoints whose gaps are smaller than \code{tau} are merged.}

\item{removeZero}{Whether remove data whose frequency is equal to zero.}

\item{cell_labels}{Logical. If \code{TRUE}, add frequency labels to cells.}

\item{label_rule}{Rule used when \code{cell_labels = TRUE}. The default
\code{"above-mean"} shows only cells whose displayed values exceed the mean
cell value. Alternatives are \code{"nonzero"} and \code{"all"}.}

\item{addFreq}{Deprecated alias for \code{cell_labels}.}
}
\value{
Return a list containing a ggplot2 object and the corresponding
frequency table.
}
\description{
Visualize the joint distribution of two continuous
interval-valued variables by dividing the x axis and y axis into
rectangles and calculating the frequency of each observation interval
in every rectangle.
}
\examples{
ggInterval_2Dhist(oils, aes(x = GRA, y = FRE),
  xBins = 5, yBins = 5,
  display = "p",
  palette = "Blues",
  cell_labels = TRUE)

ggInterval_2Dhist(oils, aes(x = GRA, y = FRE),
  method = "unequal-bin",
  display = "p",
  palette = "Blues",
  tau = 0.5)

}
