Description Usage Arguments Details Value Examples
The is a method for function prop.table
from package
base. Unlike the original function, dimension names can be used in
place of dimension indices.
1 2 3 4 5 6 7 | prop.table(x, margin = NULL)
## S4 method for signature 'DemographicArray,ANY'
prop.table(x, margin = NULL)
## S4 method for signature 'DemographicArray,character'
prop.table(x, margin = NULL)
|
x |
Object of class |
margin |
Indices or names of dimensions within which proportions are to be calculated. |
If x
has a dimension with dimtype
"Iterations"
,
and that dimension is not explicitly included in margin
, then it is
added automatically.
Object of class Values
.
1 2 3 4 5 | library(demdata)
x <- Counts(VAPopn)
prop.table(x, margin = 2:4)
## the equivalent, using dimension names
prop.table(x, margin = c("sex", "residence", "color"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.