Skip to contents

Set calculation

Usage

set_calculation(
  widget,
  columns,
  func = c("avg", "max", "min", "sum", "count", "unique"),
  precision = 2,
  pos = c("top", "bottom")
)

Arguments

widget

A tabulator() HTML widget.

columns

The names of the columns the formatter is applied to.

func

(character): The calculation function to be applied to the values of the column.

precision

(integer) The number of decimals to display. Set to FALSE to display all decimals.

pos

(character): Position at which calculated values are displayed.

Value

The updated tabulator() HTML widget

Examples

tabulator(iris) |>
  set_calculation("Sepal_Length", "avg")