tabulate_rowcol | R Documentation |
Tabulates row
variable times col
variable.
Supports tidy evaluation for row
and col
; see examples.
tabulate_rowcol(data, row, col, maxlevels = 30, rowsums = TRUE, colsums = TRUE)
data |
Data frame (tibble). |
row |
Row variable. |
col |
Column variable. |
maxlevels |
Optional. Maximum number of levels for rows and columns. If a row or column variable has more than this number of levels, for example because it is actually a continuous variable, then only a warning, not a hard error, will be shown. Defaults to 30. |
rowsums |
Optional. Show row sums? Defaults to TRUE. |
colsums |
Optional. Show column sums? Defaults to TRUE. |
Tibble.
data(mtcars)
mtcars %>%
tabulate_rowcol(gear, carb)
# Swap rows and columns, turn off totals:
mtcars %>%
tabulate_rowcol(row = carb, col = gear,
rowsum = FALSE, colsum = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.