pct | R Documentation |
A function to calculate the proportion of each value range
pct(x, method = c("auto", "bin", "cont", "fct"), na.rm = TRUE, ...)
x |
An object |
method |
A method to calculate the percentage. Default is 'auto' which will attempt to choose the most fit method. 'bin' is only meaningful for vector that only has to values. 'fct' is meaningful for descrete variable 'cont' is used for continuous variables. This will break the variable into several ranges depended on the breaks specified in ... |
na.rm |
A logical value deciding whether NA should be removed |
... |
Additional parameters passed to cut. Only work if method = 'cont' See cut |
If method == 'bin': the percentage of non-reference level
If method == 'fct': the percentages of all levels
If method == 'cont': the percentages of all ranges based on specified breaks
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.