| crosstab {janitor} | R Documentation |
This function is deprecated, use tabyl(dat, var1, var2) instead.
crosstab(...) ## Default S3 method: crosstab(vec1, vec2, percent = "none", show_na = TRUE, ...) ## S3 method for class 'data.frame' crosstab(.data, ...)
... |
additional arguments, if calling |
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 |
.data |
(optional) a data.frame, in which case |
Returns a data.frame with the frequencies of the crosstabulated variables.