I have 5 tables that I am trying to merge while preserving the row names while adding each pertinent column onto the table in an RMarkdown File. I am showing two of my tables for the example...
TABLE 1 k1_1
TABLE 2 k1_2
I want the final table to look like this:
but with the two remaining colums added to the right of "V1"
I can merge the two together using K1 <- merge(k1_1, k1_2, by="row.names")
but when I try K1 <- merge(k1_1, k1_2, k1_3, k1_4, k1_5, by = "row.names")
I have no luck
These were standard data frames with the row names as columns then I used s.data.frame(t())
to transform to this table structure.
I have also tried multiple different methods with no success.
k1_1 <- head(by_source_baseline)[1]
k1_2 <- head(by_source_allocation)[1]
k1_3 <- head(by_source_allocation)[1]
k1_4 <- head(by_source_allocation)[1]
k1_5 <- head(by_source_allocation)[1]
kable(list(k1_1, k1_2, k1_3, k1_4, k1_5))
I have also tried using merge()
, various join functions, rbind.fill( )
, and bind_rows()