set_distinct_by: Set counts to be distinct by some grouping variable.
Description
In some situations, count summaries may want to see distinct counts by a
variable like subject. For example, the number of subjects in a population
who had a particular adverse event. set_distinct_by allows you to set
the by variables used to determine a distinct count.
Usage
set_distinct_by(e, distinct_by)
Value
The layer object with
Arguments
e
A count_layer/shift_layer object
distinct_by
Variable(s) to get the distinct data.
Details
When a distinct_by value is set, distinct counts will be used by
default. If you wish to combine distinct and not distinct counts, you can
choose which to display in your f_str() objects using n,
pct, distinct_n, and distinct_pct. Additionally, denominators
may be presented using total and distinct_total