R/rreshape.R

#' Reshapes an array to a new n-dimensional array. Like Matlab
#' @param x array
#' @param ... additional parameters
#' @export
rreshape <- function(x, ...) {
    stopifnot(is.array(x))
    args <- list(...)
    if (length(args)) stopifnot(sapply(args,  is.numeric))
    array(x, dim = c(...))
}
f0nzie/rMRST documentation built on May 14, 2019, 1:44 p.m.