I\'m using dplyr\'s summarise_each to apply a function to multiple columns of data. One thing that\'s nice is that you can apply multiple functions at once. Thing is, it\'
One option is to use purrr::map_df (really map_dfc to simplify back to a data.frame with bind_cols though map_df is fine for now) with a function that makes a vector of results of each function, i.e.
library(tidyverse)
iris %>% select(contains('Petal')) %>%
map_dfc(~c(min(.x), max(.x))) %>%
mutate(stat = c('min', 'max')) # to add column of function names
#> # A tibble: 2 × 3
#> Petal.Length Petal.Width stat
#>
#> 1 1.0 0.1 min
#> 2 6.9 2.5 max