| ds_cross_table {descriptr} | R Documentation |
Creates two way tables of categorical variables. The tables created can be visualized as barplots and mosaicplots.
ds_cross_table(data, var1, var2) ## S3 method for class 'ds_cross_table' plot(x, stacked = FALSE, proportional = FALSE, print_plot = TRUE, ...) ds_twoway_table(data, var1, var2)
data |
A |
var1 |
First categorical variable. |
var2 |
Second categorical variable. |
x |
An object of class |
stacked |
If |
proportional |
If |
print_plot |
logical; if |
... |
Further arguments to be passed to or from methods. |
k <- ds_cross_table(mtcarz, cyl, gear) k # bar plots plot(k) plot(k, stacked = TRUE) plot(k, proportional = TRUE) # alternate ds_twoway_table(mtcarz, cyl, gear)