Skip to contents

Apply a column setter function to multiple columns

Usage

for_each_col(widget, columns = NULL, .f, ...)

Arguments

widget

A tabulator() HTML widget.

columns

(character vector): The columns the column setter function (.f) is applied to. If set to NULL, it is applied to all columns.

.f

(function): The column setter function that updates the column settings.

...

Arguments that are passed to .f.

Value

The updated tabulator() HTML widget

Examples

numeric_cols <- c("Sepal_Length", "Sepal_Width", "Petal_Length", "Petal_Width")

tabulator(iris) |>
  for_each_col(numeric_cols, .f = set_header_filter, type = "number", func = "<=")