Learn R Programming

cards (version 0.5.1)

.process_denominator: Process denominator Argument

Description

Function takes the ard_categorical(denominator) argument and returns a structured data frame that is merged with the count data and used as the denominator in percentage calculations.

Usage

.process_denominator(data, variables, denominator, by, strata)

Value

a data frame

Arguments

data

(data.frame)
a data frame

variables

(tidy-select)
columns to include in summaries. Default is everything().

denominator

(string, data.frame, integer)
Specify this argument to change the denominator, e.g. the "N" statistic. Default is 'column'. See below for details.

by, strata

(tidy-select)
columns to use for grouping or stratifying the table output. Arguments are similar, but with an important distinction:

by: results are tabulated by all combinations of the columns specified, including unobserved combinations and unobserved factor levels.

strata: results are tabulated by all observed combinations of the columns specified.

Arguments may be used in conjunction with one another.

Examples

Run this code
cards:::.process_denominator(mtcars, denominator = 1000, variables = "cyl", by = "gear")

Run the code above in your browser using DataLab