powered by
Inserts an extra dimension into an array at position 'posdim' with length 'lendim' and which correspond to 'lendim' repetitions of the 'var' array.
InsertDim(var, posdim, lendim)
Matrix to which a dimension should be added.
Position of the new dimension.
Length of the new dimension.
Matrix with the added dimension.
# NOT RUN { a <- array(rnorm(15), dim = c(3, 1, 5, 1)) print(dim(a)) print(dim(a[, , , ])) print(dim(InsertDim(InsertDim(a[, , , ], 2, 1), 4, 1))) # }
Run the code above in your browser using DataLab