crosstab: Generate a crosstabulation of two vectors.

Description Usage Arguments Value

View source: R/crosstab.R

Description

This function is deprecated, use tabyl(dat, var1, var2) instead.

Usage

1
2
3
4
5
6
7
8
crosstab(...)

## Default S3 method:
crosstab(vec1, vec2, percent = "none", show_na = TRUE,
  ...)

## S3 method for class 'data.frame'
crosstab(.data, ...)

Arguments

...

additional arguments, if calling crosstab on a data.frame.

vec1

the vector to place on the crosstab column. If supplying a data.frame, this should be an unquoted column name.

vec2

the vector to place on the crosstab row. If supplying a data.frame, this should be an unquoted column name.

percent

which grouping to use for percentages, if desired (defaults to "none", which returns simple counts). Must be one of "none", "row", "col", or "all".

show_na

a logical value indicating whether counts should be displayed where either variable is NA.

.data

(optional) a data.frame, in which case vec1 and vec2 should be unquoted column names.

Value

Returns a data.frame with the frequencies of the crosstabulated variables.


janitor documentation built on March 23, 2018, 1:04 a.m.