\name{xtab}
\alias{xtab}
\title{
 Crosstabulate variables
}
\description{
 Crosstabulates variables with small numbers of unique values.
}
\usage{
 xtab(formula,dataframe,dnn=NULL,fieldwidth=10,chisq=FALSE,phi=FALSE,
  include.na=FALSE)
}
\arguments{
  \item{formula}{a formula containing the variables to be crosstabulated}
  \item{dataframe}{the data frame from which to select the variables}
  \item{dnn}{labels for the variables}
  \item{fieldwidth}{the width of each cell in the display}
  \item{chisq}{logical - whether to apply a chi squared test to the table(s)}
  \item{phi}{whether to calculate and display the phi coefficient
   of association - only for 2x2 tables}
  \item{include.na}{whether to include rows or columns of NAs in the table(s).}
}
\details{
 \code{xtab} will accept a formula referring to columns in a data frame. 
 It calls \code{table} for the calculations and displays one or more tables 
 of results by calling \code{xtab.format}.
}
\value{nil}
\author{Jim Lemon}
\seealso{\code{\link{table}},\code{\link{xtab.format}}}
\examples{
 test.df<-data.frame(sex=sample(c("MALE","FEMALE"),100,TRUE),
  suburb=sample(1:4,100,TRUE),social.type=sample(LETTERS[1:4],100,TRUE))
 xtab(sex~suburb+social.type,test.df)
}
\keyword{misc}
