I want to paste all rows into the same cell column by column
For example, I have a table like as follows:
library(tibble)
tibble::tribble(
~Col1, ~Col2, ~Col3,
"AA", "AA", "AB",
"AB", "AB", "BB",
"BC", "BB", "AA"
)
Col1 Col2 Col3
AA AA AB
AB AB BB
BC BB AA
The output I want is a 3X1 table as follows:
Col1 AAABBC
Col2 AAABBB
Col3 ABBBAA
However, the real case is more complicated because my original table has 600,000 rows and 2000 columns. I'm wondering what's the most rapid way of achieving this. I tried the loop but it took forever to finish pasting rows by columns.
Any help is appreciated, thanks!