Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下の作品。より良い解決策があると確信しています。
library(dplyr) library(tidyr) iris %>% group_by(Species) %>% summarise_each(funs(mean, median)) %>% gather(var, val, -Species) %>% separate(var, c("variable", "summary"), sep = "_") %>% spread(summary, val)