orderFactors | R Documentation |
Generates ordered factors for a list of columns by name or by index or range.
orderFactors(data, ..., values, labels=NULL)
data |
data.frame |
... |
character - first varname - can be unquoted |
values |
character - second varname - can be unquoted |
labels |
character - NULL (default) or ("row", "col", "both") - can be unquoted |
data.frame - contingency table
jean.pierre.decorps@gmail.com
crossTable
library(EpiStats)
# Dataset by Anja Hauri, RKI.
data(Tiramisu)
DF <- Tiramisu
# Table with percentagges and statistic on ordered factors
DF %<>%
orderFactors(ill , values = c(1,0), labels = c("YES", "NO")) %>%
orderFactors(sex, values = c("males", "females"), labels = c("Males", "Females"))
crossTable(DF, "ill", "sex", "both", "chi2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.