Description Usage Arguments Value Examples
View source: R/QCMemo_script.R
The function summaryTable
is roughly analogous to PROC MEANS
in
SAS. The functionality is slightly more limited than PROC MEANS
, but
the results are aesthetically similar.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
inputds |
A dataset to be summarized. |
class |
A vector of names indicating variables to be used for classification. |
var |
The name of the analysis variable. |
varnames |
A named |
n |
Logical. Should frequencies be displayed? |
nmiss |
Logical. Should number of missing values be displayed? |
percent |
Logical. Should percents be displayed? |
mean |
Logical. Should means be displayed? |
min |
Logical. Should minima be displayed? |
max |
Logical. Should maxima be displayed? |
perc_digits |
A number indicating how many decimal places should be displayed for the percentages. |
digits |
A number indicating how many decimal places should be displayed for the mean, minimum, and maximum |
bg |
The background color for the columns containing the calculated
statistics. Can be given as either a name (e.g. |
date |
Logical. Is the analysis variable a date? |
A flextable
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Simple table with one class variable
summaryTable(inputds = mtcars,
class = 'cyl',
var = 'mpg',
varnames = list(cyl = 'Cylinders', mpg = 'Miles per gallon'))
# Two class variables and customization through additional parameters
summaryTable(inputds = mtcars,
class = c('cyl', 'gear'),
var = 'mpg',
varnames = list(cyl = 'Cylinders',
gear = 'Number of forward gears',
mpg = 'Miles per gallon'),
nmiss = FALSE,
perc_digits = 0,
digits = 2,
bg = 'olivedrab1')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.