I have a long data frame with multiple rows. I wish to reshape it to wide, with only 1 row left.
dput(df) >
structure(list(A = c(2, 4, 6), B = c(1, 3, 9), C = c(0, 1, 0)), row.names = c(NA,
-3L), class = c("tbl_df", "tbl", "data.frame"))
df >
A B C
1 2 1 0
2 4 3 1
3 6 9 0
I want to reshape it to :
df1 >
A_1 A_2 A_3 B_1 B_2 B_3 C_1 C_2 C_3
2 4 6 1 3 9 0 1 0