R/like.r

Defines functions like

Documented in like

#' Reshapes \code{x} to be like \code{like}, including dimension names
#'
#' @param x     An n-dimensional array
#' @param like  An n-dimensional array whose form \code{X} should inherit
#' @return      An array with values of \code{X} and structure of \code{like}
#' @export
like = function(x, like) {
    like[] = x
    like
}

Try the narray package in your browser

Any scripts or data that you put into this service are public.

narray documentation built on Oct. 2, 2022, 5:08 p.m.