Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tableby.stats.internal

Internal tableby functions


Description

A collection of functions that may help users create custom functions that are formatted correctly.

Usage

as.tbstat(
  x,
  oldClass = NULL,
  sep = NULL,
  parens = NULL,
  sep2 = NULL,
  pct = NULL,
  ...
)

as.countpct(
  x,
  ...,
  which.count = setdiff(seq_along(x), which.pct),
  which.pct = 0L
)

as.tbstat_multirow(x)

Arguments

x

Usually a vector.

oldClass

class(es) to add to the resulting object.

sep

The separator between x[1] and the rest of the vector.

parens

A length-2 vector denoting parentheses to use around x[2] and x[3].

sep2

The separator between x[2] and x[3].

pct

For statistics of length 2, the symbol to use after the second one. (It's called "pct" because usually the first statistic is never a percent, but the second often is.)

...

arguments to pass to as.tbstat.

which.count

Which statistics are counts? The default is everything except the things that are percents.

which.pct

Which statistics are percents? The default is 0, indicating that none are.

Details

The vignette has an example on how to use these.

as.tbstat defines a tableby statistic with its appropriate formatting.

as.countpct adds another class to as.tbstat to use different "digits" arguments (i.e., digits.count or digits.pct). See tableby.control.

as.tbstat_multirow marks an object (usually a list) for multiple-row printing.


arsenal

An Arsenal of 'R' Functions for Large-Scale Statistical Summaries

v3.6.2
GPL (>= 2)
Authors
Ethan Heinzen [aut, cre], Jason Sinnwell [aut], Elizabeth Atkinson [aut], Tina Gunderson [aut], Gregory Dougherty [aut], Patrick Votruba [ctb], Ryan Lennon [ctb], Andrew Hanson [ctb], Krista Goergen [ctb], Emily Lundt [ctb], Brendan Broderick [ctb], Maddie McCullough [art]
Initial release
2021-02-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.