flatten | R Documentation |
This function
flatten(stateOccupancies, categoryNames)
stateOccupancies |
an arbitrary-dimension array of (integer) state occupation counts. |
categoryNames |
a string vector of unique column names. |
a DataFrame with columns corresponding to category values and rows corresponding to individuals.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.