View source: R/count_bindings.R
set_distinct_by | R Documentation |
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.
set_distinct_by(e, distinct_by)
e |
A |
distinct_by |
Variable(s) to get the distinct data. |
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
The layer object with
#Load in pipe
library(magrittr)
tplyr_table(mtcars, gear) %>%
add_layer(
group_count(cyl) %>%
set_distinct_by(carb)
) %>%
build()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.