DescTools (version 0.99.14)

Desc.formula: Describe Variables by Groups

Description

Formula interface for describing data by groups.

Usage

## S3 method for class 'formula':
Desc(formula, data = parent.frame(), subset, 
     plotit = getOption("plotit", FALSE), ...)

Arguments

formula
a formula of the form lhs ~ rhs where lhs gives the data values and rhs the corresponding groups.
data
an optional matrix or data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).
subset
an optional vector specifying a subset of observations to be used.
plotit
boolean. Should a plot be created? The plot type will be chosen according to the classes of variables (roughly following a numeric-numeric, numeric-categorical, categorical-categorical logic). Default is FALSE.
...
further argument to be passed to methods.

Value

  • just printed summary, no value returned

Details

The formula interface accepts the formula operators +, :, *, I(), 1 and evaluates any function. The left hand side and right hand side of the formula are evaluated the same way. The variable pairs are processed in dependency of their classes by the functions DescFactFact, DescNumFact, DescFactNum and DescNumNum.

See Also

Desc.logical, Desc.factor, Desc.ordered, Desc.integer, Desc.numeric, Desc.Date, Desc.table, Desc.data.frame, Desc.list

Examples

Run this code
# univariate evaluation of temperature and driver
Desc(temperature + driver ~ 1, data=d.pizza, digits=1)

# temperature by driver
Desc(temperature ~ driver, data=d.pizza, digits=1)

# functions are evaluated
Desc(I(temperature^2) + sqrt(temperature) ~ interaction(driver, area), data=d.pizza, digits=1)

Run the code above in your browser using DataCamp Workspace