3.5 Multidimensional data structures

ToDo: Briefly introduce arrays and tables.

Isomorphic contingency tables:

datasets::Titanic
str(Titanic)  # 4-dimensional frequency table
sum(Titanic)  # 2201 cases

T_df <- as.data.frame(Titanic)
dim(T_df)       # 32 category combinations x 5 variables
sum(T_df$Freq)  # 2201 counts in Freq 

T_df_raw <- i2ds::expand_freq_table(Titanic)
dim(T_df_raw)   # 2201 cases x 4 variables 

# Note:
all.equal(table(T_df_raw), Titanic)