cross_tab_margins | R Documentation |
this is a replacement for table
that allows empty
cells because the margins have been specified. The input vectors a
and b
must be the same length, this function does no argument checking.
cross_tab_margins(a, b, a_margin, b_margin)
a |
one set of observations |
b |
another set of observations |
a_margin |
number of distinct values of a (rows) |
b_margin |
number of distinct values of b (cols) |
a <- 1:5 b <- c(1,2,3,1,2) cross_tab_margins(a,b,5,3) table(a,b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.