R/dim.r

Defines functions dim

Documented in dim

#' base::dim, but returning 1 for vector
#'
#' @param x  Object to get dimensions on
#' @export
dim = function(x) {
    if (is.null(x) || is.vector(x))
        length(x)
    else
        base::dim(x)
}

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.