| proportions | R Documentation |
Returns conditional proportions givenmargins, i.e. entries ofx, divided by the appropriate marginal sums.
proportions(x, margin = NULL)prop.table(x, margin = NULL)
x | table |
margin | a vector giving the margins to split by.E.g., for a matrix |
Table likex expressed relative tomargin
prop.table is an earlier name, retained for back-compatibility.
Peter Dalgaard
marginSums.apply,sweep are a more general mechanism for sweeping out marginal statistics.
m <- matrix(1:4, 2)mproportions(m, 1)DF <- as.data.frame(UCBAdmissions)tbl <- xtabs(Freq ~ Gender + Admit, DF)proportions(tbl, "Gender")
Add the following code to your website.
For more information on customizing the embed code, readEmbedding Snippets.
