View source: R/contingency_table.R
contingency_table | R Documentation |
Create a contingency table that takes two variables as inputs
contingency_table(
data = NULL,
row_var_name = NULL,
col_var_name = NULL,
row = NULL,
col = NULL,
output_type = "table"
)
data |
a data object (a data frame or a data.table) |
row_var_name |
name of the variable whose values will fill the rows of the contingency table |
col_var_name |
name of the variable whose values will fill the columns of the contingency table |
row |
a vector whose values will fill the rows of the contingency table |
col |
a vector whose values will fill the columns of the contingency table |
output_type |
If |
contingency_table(
data = mtcars,
row_var_name = "am",
col_var_name = "cyl")
contingency_table(row = mtcars$cyl, col = mtcars$am)
contingency_table(mtcars, "am", "cyl", output_type = "dt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.