orderFactors: Generates ordered factors.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/orderFactors.R

Description

Generates ordered factors for a list of columns by name or by index or range.

Usage

1

Arguments

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

Value

data.frame - contingency table

Author(s)

jean.pierre.decorps@gmail.com

See Also

crossTable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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")

EpiStats documentation built on June 7, 2021, 5:06 p.m.