crosstabToCases {vtree} | R Documentation |
Convert a crosstabulation into a data frame of cases.
Description
Convert a table of crosstabulated counts into a data frame of cases.
Usage
crosstabToCases(x)
Arguments
x |
a matrix or table of frequencies representing a crosstabulation. |
Value
Returns a data frame of cases.
Author(s)
Nick Barrowman, based on the countsToCases
function at http://www.cookbook-r.com/Manipulating_data/Converting_between_data_frames_and_contingency_tables/#countstocases-function
Examples
# The Titanic data set is in the datasets package.
# Convert it from a 4 x 2 x 2 x 2 crosstabulation
# to a 4-column data frame of 2201 individuals
titanic <- crosstabToCases(Titanic)
[Package vtree version 5.6.5 Index]