sumstat: Summary Statistics

sumstatR Documentation

Summary Statistics

Description

Summary statistics to be presented in a DemographicTable.

Usage

.sumstat(x, fmt, ...)

## Default S3 method:
.sumstat(x, fmt = "%.2f", ...)

## S3 method for class 'factor'
.sumstat(x, ...)

## S3 method for class 'character'
.sumstat(x, ...)

## S3 method for class 'logical'
.sumstat(x, ...)

Arguments

x

an R object

fmt

(optional) character scalar, only for the function .sumstat.default(), see function sprintf

...

additional parameters, currently not in use

Details

The function .sumstat.default() accepts all R objects of typeof double and integer. Statistics of mean, sd and range are reported. If the normality assumption via shapiro.test is not satisfied, then median and mad are also reported.

Value

The function .sumstat() returns a character scalar.

Examples

airquality$Solar.R |> .sumstat()
state.region |> .sumstat()


DemographicTable documentation built on Sept. 26, 2026, 1:07 a.m.