sumstat {DemographicTable} | R Documentation |
Summary Statistics
Description
Provide the summary statistics of an R object
Usage
.sumstat(x, fmt, ...)
## Default S3 method:
.sumstat(x, fmt = "%.2f", ...)
## S3 method for class 'factor'
.sumstat(x, ...)
## S3 method for class 'ordered'
.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 function .sumstat.default, see function sprintf |
... |
additional parameters, currently not in use |
Details
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
Function .sumstat()
returns a character scalar.
Examples
airquality$Solar.R |> .sumstat()
penguins$sex |> .sumstat()
[Package DemographicTable version 0.2.2 Index]