\begin{Schunk}
\begin{Sinput}
 oldtable <- with(dat, table(pres04, partyid))
 t1 <- prop.table(oldtable,2)
 t1
\end{Sinput}
\begin{Soutput}
       partyid
pres04  Strong Dem.       Dem. Ind. Near Dem. Independent Ind. Near Repub.     Repub. Strong Repub.
  Kerry  0.95575221 0.80040323     0.85185185  0.44000000       0.14018692 0.08436214    0.01754386
  Bush   0.04424779 0.19959677     0.14814815  0.56000000       0.85981308 0.91563786    0.98245614
\end{Soutput}
\end{Schunk}
