tabpct2: Tables with percentages

View source: R/tabfunctions.R

tabpct2R Documentation

Tables with percentages

Description

Produces one, two or multi-way tables with percentages

Usage

tabpct2(row, col = NULL, collab = "N", tex = FALSE, rowlab = NULL)

Arguments

row

factor or numeric vector which will appear in rows

col

factor or numeric vector which will appear in columns

collab

character vector of column names

tex

output in tex format (TRUE/FALSE)

rowlab

character vector of row names

Value

r x c matrix

Examples

data(iris)
tabpct2(iris$Species)
iris$hilo<-cut(iris$Sepal.Width, breaks=2)
tabpct2(iris$Species, iris$hilo)
tabpct2(iris$Species, iris$hilo, collab=c("low", "Pct.", "hi", "Pct."))
tabpct2(iris$hilo, iris$Species, rowlab=c("low", "hi", "Total"), collab=c("set", "%", "vers", "%", "virg", "%"))

wadetj/timsRstuff documentation built on April 24, 2023, 7:42 a.m.