R: Print Matrices, Old-style (original) (raw)

prmatrix {base} R Documentation

Description

An earlier method for printing matrices, provided for S compatibility.

Usage

prmatrix(x, rowlab =, collab =,
         quote = TRUE, right = FALSE, na.print = NULL, ...)

Arguments

x numeric or character matrix.
rowlab, collab (optional) character vectors giving row or column names respectively. By default, these are taken fromdimnames(x).
quote logical; if TRUE and x is of mode"character", quotes (‘⁠"⁠’) are used.
right if TRUE and x is of mode"character", the output columns are _right_-justified.
na.print how NAs are printed. If this is non-null, its value is used to represent NA.
... arguments for print methods.

Details

prmatrix is an earlier form of print.matrix, and is very similar to the S function of the same name.

Value

Invisibly returns its argument, x.

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)The New S Language. Wadsworth & Brooks/Cole.

See Also

[print.default](../../base/help/print.default.html), and other [print](../../base/help/print.html) methods.

Examples

prmatrix(m6 <- diag(6), rowlab = rep("", 6), collab = rep("", 6))

chm <- matrix(scan(system.file("help", "AnIndex", package = "splines"),
                   what = ""), , 2, byrow = TRUE)
chm  # uses print.matrix()
prmatrix(chm, collab = paste("Column", 1:3), right = TRUE, quote = FALSE)

[Package _base_ version 4.6.0 Index]