% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/table-cross_table.R
\name{cross_table}
\alias{cross_table}
\title{Generate and Display a Cross Tabulation Table}
\usage{
cross_table(
  data,
  percentage = NULL,
  layout = TRUE,
  expected = TRUE,
  layout_center = FALSE,
  header_underline = FALSE,
  digits = NULL,
  center_table = FALSE,
  style = NULL,
  ...
)
}
\arguments{
\item{data}{A matrix or table of observed frequencies.}

\item{percentage}{Which percentages to show. Options: \code{TRUE}/\code{"all"}, \code{"by_row"},
\code{"by_col"}, \code{"by_total"}, \code{FALSE}/\code{NULL}.}

\item{layout}{Show layout legend box? Default \code{TRUE}.}

\item{expected}{Show expected frequencies? Default \code{TRUE}.}

\item{layout_center}{Center the layout box? Default \code{FALSE}.}

\item{header_underline}{Shorten the underline beneath the column header? Default \code{FALSE}.}

\item{digits}{Named list with keys \code{ex}, \code{row_pct}, \code{col_pct}, \code{total_pct}.
Falls back to \code{getOption("ct_digits")}.}

\item{center_table}{Center entire table in terminal? Default \code{FALSE}.}

\item{style}{Named list supplied using \code{\link[=ct_style]{ct_style()}}.}

\item{...}{Reserved for future use.}
}
\value{
Invisibly returns the formatted cross-tabulation matrix.
}
\description{
Generate and Display a Cross Tabulation Table
}
\examples{
cross_table(matrix(c(10, 20, 30, 40), nrow = 2))
cross_table(matrix(c(10, 20, 30, 40), nrow = 2), percentage = "all")

}
