Description Usage Arguments Value Examples
View source: R/loop-summarise.R
Summarise in loop
1 2 3 | loop_summarise(.data, .x, ...)
loop_summarize(.data, .x, ...)
|
.data |
a data.frame-like object |
.x |
a vector the function is looping on |
... |
Name-value pairs of summary functions. The name will be the name of the variable in the result. The value can be:
|
An object of tibble
class
It combines multiple summaries performed on the input data.frame.
1 2 3 4 5 6 7 8 9 10 | suppressMessages(library(dplyr))
suppressMessages(library(glue))
quantiles <- c(0.25, 0.50, 0.75)
iris %>%
group_by(Species) %>%
loop_summarise(
quantiles,
glue("Petal.Length.{.x}") := quantile(Petal.Length, .x),
glue("Petal.Width.{.x}") := quantile(Petal.Width, .x)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.