Description Usage Arguments Value Examples
View source: R/table_categorical.R
Display table with comparison of the partition with categorical variables.
1 2 3 4 5 6 7 8 9 | table_categorical(
data,
partition.name,
vars.cat,
vars.cat.names = NULL,
na.value = "",
nb.dec = 1,
text.pval = FALSE
)
|
data |
The dataset. |
partition.name |
string. Name of the partition (in data). The partition variable should be a factor. |
vars.cat |
vector of strings. variables to compare to (categorical only). |
vars.cat.names |
Optional. Names for displaying the categorical
variables. (in the same order than |
na.value |
Value to use for the empty cases (e.g. |
nb.dec |
digit. Number of decimals for the percentage. |
text.pval |
boolean. Set to |
table with n and percentage values per level of the partition and chi square test p-values.
1 2 3 4 | data(cancer, package = "survival")
cancer$status <- factor(cancer$status)
table_categorical(data = cancer, partition.name = "status",
vars.cat = c("sex", "ph.ecog"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.