Description Usage Arguments Value Author(s)
Useful for producing stratified sample counts when producing tables for M&S reports. The function uses the base R table() function followed by lots of reformatting and renaming to produce a more useful output.
1 | count_strat(data, strat_col1, strat_col2 = "", pct = "by_col")
|
data |
data for analysis as a data frame. |
strat_col1 |
name of first column for result stratification. |
strat_col2 |
name of second column for result stratification. can be set to ” if second stratification is not required. |
pct |
either 'by_col' or 'by_row'. Indicates how count percentages should be calculated. |
Results are returned as a nicely formatted data frame.
Rupert Austin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.