Compute Statistics Helper Functions

A small package containing helper utilities for creating function for computing statistics.


The dostats R package is a compilation of helper utilities for computing statistics and operating on R as a language. It is particularly helpful with packages like plyr, but is useful anytime that simple functions have to be defined.


There are at present four functions of note.

  • dostats creates a function that returns a single line data.frame from a list of functions.
  • compose createa a functional composition of an arbitrary number of functions nesting each call withing the other. %.% is a opperator alias for composition of two functions.
    In other words f%.%g is equivalant to function(x)f(g(x)). There are helper functions for compose that assist in creating functions
    • wargs specifies new default arguments.
    • onarg specifies the argument that should be first in the formals list.
  • seq_consecutive will create a vector form a source vector than incriments every time the source vector changes.
  • .T is a helper function for creating character vectors without having to insert quotes.


Version 1.3.2

  • Removed files and function related to hdf that are not ready for release but were inadvertantely released in 1.3.1

Version 1.3.1

  • Documentation Updates
  • wargs carries forward attributes of original function.

Version 1.3

  • Improved wargs

Version 1.1

update 3/8/2012 Two additions * seq_consecutive follows a vector incrimenting every time there is a change in the source vector. * .T is a helper function for creating non quoted character vectors.

dostats 1.0

Initial Release 2/8/2012

contains two primary functions

  • dostats collects functions into a single function to retruns a single row data frame.
  • compose and the operator alias %.% to nest functions within each other. Helper functions are:
  • wargs wraps a function with new arguments.
  • class.stats, integer.stats, numeric.stats, and factor.stats help dostats by only doing calling the functions if the variable matches the class specified. This is very helpful with ldply to create summary tables.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.3.2 by Andrew Redd, 7 years ago

Browse source code at

Authors: Andrew Redd <[email protected]>

Documentation:   PDF Manual  

GPL (>= 3) license

Imports stats

Suggests plyr, testthat

See at CRAN