% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sjStatistics.R
\name{table_values}
\alias{table_values}
\title{Expected and relative table values}
\usage{
table_values(tab, digits = 2)
}
\arguments{
\item{tab}{Simple \code{\link{table}} or \code{\link[stats]{ftable}} of which
cell, row and column percentages as well as expected values are calculated.
Tables of class \code{\link[stats]{xtabs}} and other will be coerced to
\code{ftable} objects.}

\item{digits}{Amount of digits for the table percentage values.}
}
\value{
(Invisibly) returns a list with four tables:
\enumerate{
\item \code{cell} a table with cell percentages of \code{tab}
\item \code{row} a table with row percentages of \code{tab}
\item \code{col} a table with column percentages of \code{tab}
\item \code{expected} a table with expected values of \code{tab}
}
}
\description{
This function calculates a table's cell, row and column percentages as
well as expected values and returns all results as lists of tables.
}
\examples{
tab <- table(sample(1:2, 30, TRUE), sample(1:3, 30, TRUE))
# show expected values
table_values(tab)$expected
# show cell percentages
table_values(tab)$cell

}
