Description Usage Details Examples
Enhance functions like transform
, mutate
, summarize
... by allowing
arguments to reference themselves when they are formulas.
1 |
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.