R/mhead.R

Defines functions mhead

Documented in mhead

#' Head of a matrix
#'
#' This function makes it easier to show the head of a matrix object without
#' all the columns. It takes a matrix object and a number and show the
#' given number of rows and columns
#'
#' @param given_object a \code{matrix} object
#' @param n an integer number of the number of rows and columns to show
#'
#' @examples
#' m <- matrix(rnorm(1000), ncol = 1000)
#' mhead(m)
#'
#' @importFrom utils head
#' @export
mhead <- function(given_object, n = 5) {
  head(given_object, n = n)[, 1:n]
}
Rekyt/divr documentation built on April 1, 2020, 5:35 a.m.