summaryStats: Create a function that calculates the summary statistics

Description Usage Arguments Details Value Author(s) Examples

Description

Create a customized function that calculates desired summary statistics for a vector of numerical input

Usage

1

Arguments

stats

A character vector of summary statistics. See details for acceptable values.

Details

The acceptable values of stats are

"min"

minimum

"q1"

first quartile (25th percentile)

"mean"

mean

"med"

median (50th percentile)

"q3"

third quartile (75th percentile)

"max"

maximum

"sd"

standard deviation

"sum"

sum

"ss"

sum of squares

"count"

number of non-missing elements in the vector

"skew

skewness

"kurt"

kurtosis (Pearson's measure)

All statistics are calcuated such that if there are too many NAs, an NA is returned. The 'moments' package namespace is loaded if skew or kurt are requested.

Value

A function of class summaryStats_function that takes a single argument of a numerical vector, and returns a named vector of the summary statistics of that vector

Author(s)

Landon Sego

Examples

1
2
3
f <- summaryStats(c("q3","q1","mean","count","med"))
f
f(rnorm(200))

pnnl/qFeature documentation built on May 25, 2019, 10:22 a.m.