RAnEnExtra::replicateDimension replicates a particular dimensions of the arrray.

replicateDimension(arr, times, dimension)

Arguments

arr

An array

times

How many times to duplicate the dimension

dimension

Which dimension to duplicate