[R] constructing a contingency table (ftable, table)

stefan.duke at gmail.com stefan.duke at gmail.com
Tue Jun 8 15:42:18 CEST 2010


Dear all,
an hopefully quick table question.

I have the following data:
Two objects that are 2*9 matrix with nine column names (Dis1, ...,
Dis9) and the row names (2010,2020). The content are frequencies
(numeric).

In want to create a table that is along the lines of
ftable(UCBAdmissions) and should looks like this:
Dis1 | ...| Dis9
2010|2020|....|2010|2020
(first row,first column is the value of Dis1 in 2010 from first
object)| (first row,second column is the value of Dis1 in 2020 from
first object)| ....
(second row,first column is the value of Dis1 in 2010 from second
object)| (first row,second column is the value of Dis1 in 2020 from
second object)| ....
and so on

So basically what ftable does. But I do not understand how I can turn
my two matrices (which already contain the frequencies) into the
appropriate table object (if thats the way to go).

Thanks and best,
Stefan



More information about the R-help mailing list