For each column of a dataframe, generate a LaTeX table against a given variable using displayKbyC
and add a suitable
displayCrossTabs(vars, v0, nam0, lab0,
percentage = c("none", "row", "col", "total")[1],
add.p = TRUE)
Displays LaTeX K x C tables and returns a list containing all the information.
Dataframe of nominal variables.
Nominal variable to tabulate all columns of vars
against.
Name of v0
.
Initial string for table label. The column number of vars
will be added, so that each table has a unique label.
Add percentages with respect to row, column, or table total.
Logical. If true, add
Kaspar Rufibach (maintainer), kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
set.seed(1977)
v0 <- round(runif(20, 0, 5))
v1 <- round(runif(20, 0, 3))
v2 <- round(runif(20, 0, 4))
displayCrossTabs(vars = data.frame(v1, v2), v0, nam0 = "v0", lab0 = "Q1")
Run the code above in your browser using DataLab