dplyr: summarise each column and return list columns
问题 I am looking to summarize each column in a tibble with a custom summary function that will return different sized tibbles depending on the data. Let’s say my summary function is this: mysummary <- function(x) {quantile(x)[1:sample(1:5, 1)] %>% as_tibble} It can be applied to one column as such: cars %>% summarise(speed.summary = list(mysummary(speed))) But I can't figure out a way to achieve this using summarise_all (or something similar). Using the cars data, the desired output would be: