cat_desc_stats | R Documentation |
cat_desc_stats
computes absolute and relative frequencies for
categorical data with a number of formatting options.
cat_desc_stats(
source = NULL,
separator = " ",
return_level = TRUE,
ndigit = 0,
groupvar = NULL,
singleline = FALSE,
percent = TRUE,
prettynum = FALSE,
.german = FALSE,
quelle = NULL
)
source |
Data for computation. Previously "quelle". |
separator |
delimiter between results per level, preset as ' '. |
return_level |
Should levels be reported? |
ndigit |
Digits for rounding of relative frequencies. |
groupvar |
Optional grouping factor. |
singleline |
Put all group levels in a single line? |
percent |
Logical, add percent-symbol after relative frequencies? |
prettynum |
logical, apply prettyNum to results? |
.german |
logical, should "." and "," be used as bigmark and decimal? Sets prettynum to TRUE. |
quelle |
deprecated, retained for compatibility, use 'source' instead. |
Structure depends on parameter return_level: if FALSE than a tibble with descriptives, otherwise a list with two tibbles with levels of factor and descriptives. If parameter singleline is FALSE (default), results for each factor level is reported in a separate line, otherwise they are pasted. Number of columns for result tibbles is one or number of levels of the additional grouping variable.
cat_desc_stats(mtcars$gear)
cat_desc_stats(mtcars$gear, return_level = FALSE)
cat_desc_stats(mtcars$gear, groupvar = mtcars$am)
cat_desc_stats(mtcars$gear, groupvar = mtcars$am, singleline = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.