print_matrix: Print (abbreviated) 'matrix'

View source: R/print_matrix.R

print_matrixR Documentation

Description

This function prints a (possibly abbreviated) matrix.

Usage

print_matrix(
  x,
  rowdots = 4,
  coldots = 4,
  digits = 2,
  label = NULL,
  simplify = FALSE,
  details = !simplify
)

Arguments

x

[atomic() | matrix]
The object to be printed.

rowdots

[integer(1)]
The row number which is replaced by ....

coldots

[integer(1)]
The column number which is replaced by ....

digits

[integer(1)]
The number of printed decimal places if input x is numeric.

label

[character(1)]
A label for x. Only printed if simplify = FALSE.

simplify

[logical(1)]
Simplify the output?

details

[logical(1)]
Print the type and dimension of x?

Value

Invisibly returns x.

References

This function is a modified version of ramify::pprint().

See Also

Other package helpers: Dictionary, Storage, identical_structure(), input_check_response(), match_arg(), package_logo(), print_data.frame(), renv_development_packages(), system_information(), unexpected_error(), user_confirm()

Examples

print_matrix(x = 1, label = "single numeric")
print_matrix(x = LETTERS[1:26], label = "letters")
print_matrix(x = 1:3, coldots = 2)
print_matrix(x = matrix(rnorm(99), ncol = 1), label = "single column matrix")
print_matrix(x = matrix(1:100, nrow = 1), label = "single row matrix")
print_matrix(x = matrix(LETTERS[1:24], ncol = 6), label = "big matrix")
print_matrix(x = diag(5), coldots = 2, rowdots = 2, simplify = TRUE)

oeli documentation built on Oct. 16, 2024, 5:08 p.m.