set_numeric_threshold: Set a numeric cutoff

View source: R/count_bindings.R

set_numeric_thresholdR Documentation

Set a numeric cutoff

Description

[Experimental]

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 count_layer object

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")
  )

Tplyr documentation built on May 29, 2024, 10:37 a.m.