powered by
Convert a table of crosstabulated counts into a data frame of cases.
crosstabToCases(x)
Returns a data frame of cases.
a matrix or table of frequencies representing a crosstabulation.
Nick Barrowman, based on the countsToCases function at http://www.cookbook-r.com/Manipulating_data/Converting_between_data_frames_and_contingency_tables/#countstocases-function
countsToCases
# 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)
Run the code above in your browser using DataLab