self_referencing: self_referencing tag to allow self referencing in arguments

Description Usage Details Examples

Description

Enhance functions like transform, mutate, summarize ... by allowing arguments to reference themselves when they are formulas.

Usage

1

Details

to detect rigorously the type of the argument it would be necessary to evaluate it, which for these functions is not an option, therefore we just check if the expressions starts with a ~ character.

Examples

1
2
3
4
5
6
self_referencing$transform(head(iris,2), Petal.Width = ~1000*(.), Species = ~toupper(.))
## Not run: 
library(dplyr)
self_referencing$summarize(iris, Petal.Width = ~median(.), Sepal.Length = ~mean(.))

## End(Not run)

moodymudskipper/tags documentation built on June 25, 2019, 10:54 a.m.