fftable: Create a table from a formula

Description Usage Arguments Details Value Examples

Description

fftable splits data by unique values of formula's right hand side, and evaluates the left hand side for each subset.

Usage

1
2
3
4
5
## Default S3 method:
fftable(data, ...)

## S3 method for class 'formula'
fftable(formula, data = parent.frame(), subset = NULL)

Arguments

data

a data frame (or list or environment) containing the variables referred to in formula.

formula

a formula object with exactly one term on the LHS and RHS.

subset

an optional vector specifying a subset of data.

Details

The default method simply passes its arguments on to fftable.formula, taking the first argument as data. This plays nicely with dplyr-package.

Value

A data frame like that from aggregate.

Examples

1
2
3
4
5
6
7
8
9
fftable(mean(mpg) ~ gear, mtcars)
fftable(range(mpg) ~ gear, mtcars)
fftable(mpg ~ gear, mtcars)
fftable(cbind(range(mpg), quantile(mpg, c(0.25, 0.75))) ~ gear, mtcars)
## Not run: 
library(dplyr)
mtcars %>% fftable(range(mpg) ~ gear)

## End(Not run)

hughjonesd/ffplot documentation built on May 17, 2019, 9:11 p.m.