Learn R Programming

NCmisc (version 1.2.0)

summary2: Descriptive summary with SD/SE + improved formatting

Description

Wrapper for the base function summary() but adds standard deviation, standard error, and an 'N' and missing 'NA' count that are consistent.

Usage

summary2(x, digits = NULL, neaten.names = TRUE)

Value

array of descriptive statistics for x

Arguments

x

vector of numeric data

digits

number of digits to round resulting values to

neaten.names

logical, TRUE removes period and space from names of the results returned by summary() to make the names better for use in a data.frame.

Author

Nicholas Cooper njcooper@gmx.co.uk

Examples

Run this code
x <- 1:100
summary2(x, digits=2)
summary2(c(x, NA, NA), digits=2)

Run the code above in your browser using DataLab