Learn R Programming

pairwise (version 0.4.4-5.1)

ftab: Tabulating Answer Categories in Data

Description

function tabulating (answer) categories in X.

Usage

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.

Value

a "matrix" with category frequencies

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).

Examples

Run this code
# NOT RUN {
########
data(bfiN)
ftab(bfiN)
data(sim200x3)
ftab(sim200x3)
# }

Run the code above in your browser using DataLab