There is a function in Mathematica called "Riffle" that can be used for inserting columns of a matrix between columns of another matrix.For example, for m1
and m2
matrices like these:
m1= 1 1 1
1 1 1
1 1 1
m2=2 2 2
2 2 2
2 2 2
it creates
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
is there any equivalent function in R for doing this?