groupwise.data.frame: Calculate Widgets With and Without Groups

groupwise.data.frameR Documentation

Calculate Widgets With and Without Groups

Description

Calculates widgets with and without groups. Supplies 'groupfull' and 'groupless' (prefixed) columns instead of 'widgets'. Column attributes 'label' and 'title' (highest priority) are substituted for column name, if present.

Usage

## S3 method for class 'data.frame'
groupwise(
  x,
  fun = list(sum ~ sum(x, na.rm = TRUE), pct ~ signif(digits = 3, sum/n * 100), ave ~
    signif(digits = 3, mean(x, na.rm = TRUE)), std ~ signif(digits = 3, sd(x, na.rm =
    TRUE)), med ~ signif(digits = 3, median(x, na.rm = TRUE)), min ~ signif(digits = 3,
    min(x, na.rm = TRUE)), max ~ signif(digits = 3, max(x, na.rm = TRUE))),
  fac = list(` ` ~ sum + " (" + pct + "%" + ")"),
  num = list(`Mean (SD)` ~ ave + " (" + std + ")", `Median (range)` ~ med + " (" + min +
    ", " + max + ")"),
  ...
)

Arguments

x

data.frame

fun

passed to groupfull() and groupless()

fac

passed to groupfull() and groupless()

num

passed to groupfull() and groupless()

...

passed to groupfull() and groupless()

Value

class 'groupwise', arranged by groups:

_tablet_name

observation identifier

_tablet_level

factor level or LHS of formulas in 'num'

_tablet_N

number of records

_tablet_n

number of records in group

_tablet_groupfull

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

_tablet_groupless

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


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