pprint: Print abbreviated matrices and vectors

View source: R/utils.R

pprintR Documentation

Print abbreviated matrices and vectors

Description

This function prints abbreviated matrices and vectors.

Usage

pprint(x, rowdots = 4, coldots = 4, digits = 4, name = NULL, desc = TRUE)

Arguments

x

A (numeric or character) matrix or a vector.

rowdots

The row number which is replaced by dots.

coldots

The column number which is replaced by dots.

digits

If x is numeric, sets the number of decimal places.

name

Either NULL or a label for x. Only printed if desc = TRUE.

desc

Set to TRUE to print the name and the dimension of x.

Value

Invisibly returns x.

References

This function is a modified version of the pprint() function from the ramify R package.

Examples

RprobitB:::pprint(x = 1, name = "single integer")
RprobitB:::pprint(x = LETTERS[1:26], name = "letters")
RprobitB:::pprint(x = matrix(rnorm(100), ncol = 1),
                  name = "single column matrix")
RprobitB:::pprint(x = matrix(1:100, nrow = 1), name = "single row matrix")
RprobitB:::pprint(x = matrix(LETTERS[1:24], ncol = 6), name = "big matrix")


RprobitB documentation built on Nov. 10, 2022, 5:12 p.m.