cross_tab_to_obsv_tab: Convert a contingency table to a long-format observation-level data frame
Description
cross_tab_to_obsv_tab() expands a contingency table or matrix of counts
into a long-format data frame where each row represents one observation. The
output contains one column per dimension of the input, with repeated rows
according to the frequency counts.
A data.frame in long format with one row per implied observation
and one column per dimension of the input table.
Arguments
cross_tab
A two-way or multi-way contingency table (matrix or
table) with named dimnames. Each combination of factor levels is
assumed to represent a count of occurrences.
strings_as_factors
Should character columns in the output
be converted to factors?