summarywidget: Show a single summary statistic in a widget

Description Usage Arguments See Also

View source: R/summarywidget.R

Description

A summarywidget displays a single statistic derived from a linked table. Its primary use is with the crosstalk package. Used with crosstalk, a summarywidget displays a value which updates as the data selection changes.

Usage

1
2
3
summarywidget(data, statistic = c("count", "sum", "mean"), column = NULL,
  selection = NULL, digits = 0, width = NULL, height = NULL,
  elementId = NULL)

Arguments

data

Data to summarize, normally an instance of crosstalk::SharedData.

statistic

The statistic to compute.

column

For sum and mean statistics, the column of data to summarize. Not used for count statistic.

selection

Expression to select a fixed subset of data. May be a logical vector or a one-sided formula that evaluates to a logical vector. If used, the key given to crosstalk::SharedData must be a fixed column (not row numbers).

digits

Number of decimal places to display, or NULL to display full precision.

See Also

https://kent37.github.io/summarywidget


kent37/summarywidget documentation built on May 20, 2019, 9:05 a.m.