I recreate nested frequency tables from articles over and over again using the matrix and recreating the tables (or sometimes refusing and using repand making a complete data set that takes a lot of time. I am looking for the fastest (smallest code) to recreate this nested frequency table in R (I assume this is a question that many can learn from this).
gender female male
hs.grad race
no asian 3 4
black 5 10
white 17 11
yes asian 5 7
black 1 9
white 11 17
It was created with help ftable, if useful.
Thanks in advance.
source
share