R/utils.R

Defines functions dim_and_class

Documented in dim_and_class

#' Description array size and type
#'
#' @param x Matrix or vector
#'
#' @return Description as character vector
#' @export
dim_and_class <- function(x) {
  if (is.vector(x))
    paste0(length(x), "      [", class(x)[1], "]")
  else
    # is a matrix
    paste0(nrow(x), " x ", ncol(x), " [", class(x)[1], "]")
}

Try the LRMF3 package in your browser

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

LRMF3 documentation built on Feb. 10, 2022, 1:09 a.m.