powered by
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 ds_cross_table plot(x, stacked = FALSE, proportional = FALSE, print_plot = TRUE, ...)ds_twoway_table(data, var1, var2)
# S3 method for ds_cross_table plot(x, stacked = FALSE, proportional = FALSE, print_plot = TRUE, ...)
ds_twoway_table(data, var1, var2)
A data.frame or a tibble.
data.frame
tibble
First categorical variable.
Second categorical variable.
An object of class cross_table.
cross_table
If FALSE, the columns of height are portrayed as stacked bars, and if TRUE the columns are portrayed as juxtaposed bars.
FALSE
TRUE
If TRUE, the height of the bars is proportional.
logical; if TRUE, prints the plot else returns a plot object.
Further arguments to be passed to or from methods.
# NOT RUN { 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) # }
Run the code above in your browser using DataLab