prv.large: Tidy display function for matrix objects

View source: R/NCmisc.R

prv.largeR Documentation

Tidy display function for matrix objects

Description

This function prints the first and last columns and rows of a matrix, and more, if desired. Allows previewing of a matrix without overloading the console. Most useful when data has row and column names.

Usage

prv.large(
  largeMat,
  rows = 3,
  cols = 2,
  digits = 4,
  rL = "Row#",
  rlab = "rownames",
  clab = "colnames",
  rownums = T,
  ret = FALSE,
  warn = TRUE
)

Arguments

largeMat

a matrix

rows

number of rows to display

cols

number of columns to display

digits

number of digits to display for numeric data

rL

row label to describe the row names/numbers, e.g, row number, ID, etc

rlab

label to describe the data rows

clab

label to describe the data columns

rownums

logical, whether to display rownumbers or ignore them

ret

logical, whether to return the result as a formatted object, or just print to console

warn

logical, whether to warn if the object type is not supported

Examples

mat <- matrix(rnorm(1000),nrow=50)
rownames(mat) <- paste("ID",1:50,sep="")
colnames(mat) <- paste("Var",1:20,sep="")
prv.large(mat)
prv.large(mat,rows=9,cols=4,digits=1,rlab="samples",clab="variables",rownums=FALSE)

NCmisc documentation built on Oct. 17, 2022, 5:09 p.m.