Description Usage Arguments Value Examples
View source: R/QCMemo_script.R
The function freqTable
is somewhat analagous to PROC FREQ
in
SAS. The functionality is slightly different and more limited, but the
results are aesthetically similar.
1 2 3 4 5 6 7 8 9 |
inputds |
A dataset with one row per unit (i.e. a Step 2 dataset). |
variables |
A vector of names indicating the variables you would like to be cross-tabulated. |
varnames |
A named |
n |
Logical. Should frequencies be displayed? |
percent |
Logical. Should percents be displayed? |
perc_digits |
A number indicating how many decimal places should be displayed for the percentages. |
bg |
The background color for the columns containing the calculated
statistics. Can be given as either a name (e.g. |
A flextable
object.
1 2 3 4 5 6 7 8 9 10 11 | # Simple cross-tabulation using default options
freqTable(inputds = mtcars,
variables = c('cyl', 'gear', 'carb'))
# Using options to customize table further
freqTable(inputds = mtcars,
variables = c('cyl', 'gear', 'carb'),
varnames = list(cyl = 'Cylinders', gear = 'Forward gears', carb = 'Carburetors'),
n = FALSE,
perc_digits = 0,
bg = rgb(.2, .1, .2, .3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.