Generate a crosstabulation of two vectors.

Description

Create a crosstab, displaying either frequencies or percentages calculated by row, column, or overall.

crosstab can be called in two ways:

1) It can simply be called on two vectors, like crosstab(mtcars$gear, mtcars$cyl).

2) Or, when both vectors are columns in a single data.frame, the data.frame can be provided as the first argument, followed by two unquoted column names to crosstabulate. This enables passing in a data.frame from a %>% pipeline, in addition to making for a shorter function call. Like mtcars %>% crosstab(gear, cyl).