temptable<-structure(c(0L, 2L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L,
proptable <- prop.table(temptable,margin=c(1,2))
print(proptable)
margintable <- margin.table(temptable,margin=c(1,2))
print(margintable)
I have a simple table below called temptable and i want to obtain the
same structure that prop.table creates except get the counts
rather than the proportions. margin.table seems to create one table with
columns and rows whereas I am looking for the three table
type structure that prop.table gives. Thanks.
0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 1L, 1L, 1L, 0L, 0L, 2L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 0L, 1L, 0L,
0L, 2L, 1L, 0L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L,
1L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 3L), .Dim = c(8L, 4L, 3L), .Dimnames = structure(list(
c("(-1,-0.75]", "(-0.75,-0.5]", "(-0.5,-0.25]", "(-0.25,0]",
"(0,0.25]", "(0.25,0.5]", "(0.5,0.75]", "(0.75,1]"),
c("(-Inf,-0.001]",
"(-0.001,0]", "(0,0.001]", "(0.001, Inf]"), c("Neutral",
"Negative", "Positive")), .Names = c("", "", "")), class = "table")
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Jul 2008 - 03:31:32 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.