Learn R Programming

dostats (version 1.2.0)

dostats: Convenient interface for computing statistics on a vector

Description

Convenient interface for computing statistics on a vector

Usage

dostats(x, ..., .na.action = na.fail)

Arguments

x
the vector
...
statistics to compute, must take a vector and return a vector
.na.action
the action to take on NA values, for all statistics

Value

  • A one row data.frame with columns named as in ...

See Also

ldply

Examples

Run this code
data(mtcars)
library(plyr)
dostats(1:10, mean, median, sd, quantile, IQR)
ldply(mtcars, dostats, median, mean, sd, quantile, IQR)

Run the code above in your browser using DataLab