I have three datasets (tibble), all with the same column names
A_table <- tibble(col_1 = c(1,2), col_2 = c("a1", "a2"))
B_table <- tibble(col_1 = c(1,4), col_2 = c("b11", "b3"))
C_table <- tibble(col_1 = c(5,9), col_2 = c("c21", "c2"))
tables <- ls(pat = "_table")
#doesnt work:
combine <- tables %>%
reduce(bind_rows)
The combine doesn't work because tables is just a list with the table names, not with the real tables.
What is an easy way to combine the three tables? How do I get the tables in the variable tables and not only the table names using a pattern?
I don't want to bind them manually, e.g.:
combine <- A_table %>%
bind_rows(B_table) %>%
bind_rows(C_table)
because in I have many more columns that I want to combine.
I appreciate any advise! Thank you!