This function
flatten(stateOccupancies, categoryNames)
an arbitrary-dimension array of (integer) state occupation counts.
a string vector of unique column names.
a DataFrame with columns corresponding to category values and rows corresponding to individuals.
# NOT RUN {
gender=c(51,49)
age=c(17,27,35,21)
states=qis(list(1,2),list(gender,age))$result
table=flatten(states,c("Gender","Age"))
print(nrow(table[table$Gender==1,])) # 51
print(nrow(table[table$Age==2,])) # 27
# }
Run the code above in your browser using DataLab