Last data update: 2014.03.03

R: Descriptive Univariate Statistics for Numerical Data
descrR Documentation

Descriptive Univariate Statistics for Numerical Data

Description

Calculates mean, standard deviation, min, max, median, MAD, IQR, CV, skewness, SE.skewness, and kurtosis.

Usage

descr(x, na.rm=TRUE, style="simple", round.digits=2,
     justify="right", plain.ascii=TRUE, file=NA,
     append=FALSE, transpose=FALSE,
     escape.pipe=FALSE, ...)

Arguments

x

Numerical vector.

na.rm

argument to be passed to statistical functions. Defaults to TRUE.

style

Style of pander tables. Defaults to dQuotegrid.

round.digits

Number of sig. digits to keep. Defaults to 2.

justify

pander argument. Defaults to “right”.

plain.ascii

pander argument; when results are displayed in console, this avoids having markdown markup characters int the tables. Defaults to TRUE.

file

File name to write output to. Defaults to NA. To append output to an existing text file, use append=TRUE.

append

When “file” argument is supplied, this indicates whether to append output to existing file (TRUE) or to overwrite any existing file (FALSE, default). If TRUE and no file exists, a new file will be created.

transpose

Makes variables appears as columns, and stats as rows. Defaults to FALSE.

escape.pipe

Only useful when style='grid' and file argument is not NA, in which case it will escape the pipe character (|) to allow Pandoc to correctly convert multiline cells.

...

Additional arguments passed to pander.

Value

A list with 2 elements; first one in a matrix (table) containing all the stats. Second, a table of statistics and table of counts (valid vs <NA> observations).

Author(s)

Dominic Comtois <dominic.comtois@gmail.com>

References

https://github.com/dcomtois/summarytools

Examples

data(exams)
descr(exams)
descr(exams, transpose=TRUE)

Results