Tabulating Answer Categories in Data

Description

Function tabulating (answer) categories in X.

Usage

1
ftab(X, catgories = NULL, na.omit = FALSE)

Arguments

X

Data as a "matrix", a "data.frame" or even a "vector" or "factor". "vector" or "factor" are coerced to a "data.frame" with one column.

catgories

optional a vector ("numeric" or "character") containig the categories to tabulate. At default (catgories=NULL) the fuction looks for unique categories in X.

na.omit

logical (default: na.omit=FALSE ) wether to return frequencies for missing values, NAs.

Details

X can either be a ("numeric" or "character") "matrix" containing response vectors of persons (rows) or a "data.frame" containing "numeric", "character" or "factor" variables (columns).

Value

a "matrix" with category frequencies

Examples

1
2
3
########
data(suicide)
ftab(suicide)