set_numeric_threshold {Tplyr} | R Documentation |
Set a numeric cutoff
Description
In certain tables, it may be necessary to only include rows that meet numeric conditions. Rows that are less than a certain cutoff can be suppressed from the output. This function allows you to pass a cutoff, a cutoff stat(n, distinct_n, pct, or distinct_pct) to supress values that are lesser than the cutoff.
Usage
set_numeric_threshold(e, numeric_cutoff, stat, column = NULL)
Arguments
e |
A |
numeric_cutoff |
A numeric value where only values greater than or equal to will be displayed. |
stat |
The statistic to use when filtering out rows. Either 'n', 'distinct_n', or 'pct' are allowable |
column |
If only a particular column should be used to cutoff values, it can be supplied here as a character value. |
Value
The modified Tplyr layer object
Examples
mtcars %>%
tplyr_table(gear) %>%
add_layer(
group_count(cyl) %>%
set_numeric_threshold(10, "n") %>%
add_total_row() %>%
set_order_count_method("bycount")
)
[Package Tplyr version 1.2.1 Index]