I'd like to make a table that looks like this
I have tibbles with each of the data points, but they're not combined.
library('dplyr')
library('ISLR')
data(Hitters)
Hitters <- na.omit(Hitters)
Q <- Hitters %>% group_by(League) %>%
dplyr::summarize(count = n(), avg_wage = sum(Salary)/n())
A <- Hitters %>% group_by(Division) %>%
dplyr::summarize(count = n(), avg_wage = sum(Salary)/n())
Z <- Hitters %>% group_by(NewLeague) %>%
dplyr::summarize(count = n(), avg_wage = sum(Salary)/n())
My goal is to stack the tibbles above each other in one output with shared "count" and "avg_wage" columns. I tried bind_rows() and ftable(), without success.