warp_tbl: Given a data frame and two column names, this function...

Description Usage Arguments Examples

Description

Given a data frame and two column names, this function returns a data frame where groupings of the first variable contain differences with respect to the second variable.

Usage

1
warp_tbl(tbl, grouping, warp_by)

Arguments

tbl

A data frame with at least two columns

grouping

The column name specifying how to group the rows.

warp_by

The column name specifying the differences within groups to look for.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

fruit_prices <- data.frame(Fruit = c("Apple", "Apple", "Orange", "Orange", "Pear", "Pear"),
                           Price = c(1.2, 1.3, 1.1, 1.1, 1.4, 1.1))
warp_tbl(fruit_prices, "Fruit", "Price")
warp_tbl(fruit_prices, "Price", "Fruit")


## End(Not run)

seankross/warppipe documentation built on May 29, 2019, 4:55 p.m.