Learn R Programming

⚠️There's a newer version (1.3.3) of this package.Take me there.

Do Stats R Package

Introduction

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.

Details

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.

Copy Link

Version

Install

install.packages('dostats')

Monthly Downloads

287

Version

1.3.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Andrew Redd

Last Published

May 29th, 2015

Functions in dostats (1.3.2)

%contains%

Does a table contain a value
collect

collect results
compose

Nest functions
wargs

Call with arguments.
dostats

Convenient interface for computing statistics on a vector
fill_v

Fill vector to length with a specified value
make_call

Make a call with extra arguments incorporated into call.
class.stats

Filter by class
make_new_id

Make a helper ID counter
first

Head/Tail shortcuts
listrows

List rows of a data frame in a list.
redirf

Create a function that redirects to the named function.
seq_consecutive

compute an indicator to group consecutive values
pval

Extract a p-value fomr a test result.
me

Return the current function
onarg

change first argument of a function
.T

create a text vector
capply

Conditional Apply