Calculates widgets with and without groups. Supplies 'groupfull' and 'groupless' (prefixed) columns instead of 'widgets'.
# S3 method for 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 + ")"),
...
)
class 'groupwise', arranged by groups:
observation identifier
factor level or LHS of formulas in 'num'
number of records
number of records in group
the LHS of formulas in 'fac' and 'num'
the LHS of formulas in 'fac' and 'num'
data.frame
passed to groupfull() and groupless()
passed to groupfull() and groupless()
passed to groupfull() and groupless()
passed to groupfull() and groupless()