widgets.devalued: Calculate Widgets for Devalued

View source: R/tablet.R

widgets.devaluedR Documentation

Calculate Widgets for Devalued

Description

Calculates widgets for class 'devalued'. In this context, a widget is a text fragment that formats one or more aggregate statistics, all of which must have been present as LHS of some element of 'fun' in the call to devalued(). Furthermore, LHS must be unique across 'fac' and 'num' for expected behavior.

Usage

## S3 method for class 'devalued'
widgets(
  x,
  fac = list(` ` ~ sum + " (" + pct + "%" + ")"),
  num = list(`Mean (SD)` ~ ave + " (" + std + ")", `Median (range)` ~ med + " (" + min +
    ", " + max + ")"),
  ...
)

Arguments

x

devalued

fac

a list of formulas to generate widgets for factors

num

a list of formulas to generate widgets for numerics

...

formulas with matching LHS replace defaults

Details

In the context of this call, "+" is redefined to allow concatenation of text. Evaluation proceeds left to right as usual.

Value

class 'widgets', arranged by groups:

_tablet_name

observation identifier

_tablet_level

factor level (or special value 'numeric' for numerics)

_tablet_N

number of records

_tablet_n

number of records in group

_tablet_stat

the LHS of formulas in 'fac' and 'num'

_tablet_widget

the RHS of formulas in 'fac' and 'num' (evaluated)


tablet documentation built on Sept. 16, 2023, 1:08 a.m.