Learn R Programming

qdap (version 1.3.5)

mtabulate: Tabulate Frequency Counts for Multiple Vectors

Description

A wrapper for tabulate that works on multiple vectors.

Usage

mtabulate(vects)

Arguments

vects
A list of named/unnamed vectors.

Value

  • Returns a dataframe with frequency counts per list item (levels unused by any vectors in the list are dropped). If list of vectors is named these will be the rownames of the dataframe.

References

http://stackoverflow.com/a/9961324/1000343

See Also

tabulate

Examples

Run this code
mtabulate(list(w=letters[1:10], x=letters[1:5], z=letters))
mtabulate(list(mtcars$cyl[1:10]))

## Dummy coding
mtabulate(mtcars$cyl[1:10])
mtabulate(CO2[, "Plant"])

dat <- data.frame(matrix(sample(qcv(A, B), 30, TRUE), ncol=3))
t(mtabulate(dat))

Run the code above in your browser using DataLab