I have a data frame as follows:
A1 A2 A3
1 2 3
1 2 3
I would like to convert the dataframe above into something like this:
M1 M1 M1 ..... M1 M2 M2 ...... M3 M3 M3 ...... M3
1 1 1 ..... 1 2 2 ...... 2 3 3 ...... 3
1 1 1 ..... 1 2 2 ...... 2 3 3 ...... 3
where M1, M2 and M3 are repeated 12 times (for each month)
I have tried the duplicate
function. It worked if I only attempted to duplicate one column. However, everything went haywire if I tried more than 2 columns.
Thanks