latexMat: Write LaTeX code to print a matrix

Description Usage Arguments Examples

View source: R/latexMat.R

Description

Write LaTeX code to print a matrix

Usage

1
2
latexMat(mat, matType = "pmatrix", fractions = TRUE, digits = 3,
  align = "r")

Arguments

mat

The matrix to be printed

matType

Bracketing type for the matrix. Defaults to "pmatrix"

fractions

Should we write the elements in fraction form (uses MASS package)? Defaults to TRUE

digits

Number of decimal places to print (if not using fractions)

align

Number alignment within columns. Options are "c" for center, "r" for right, "l" for left. Default is right aligned.

Examples

1
2
3
4
5
## Make the matrix
a <- rbind(1:4, 5:8/10)

## Apply the print function
latexMat(a)

lcomm/ltools documentation built on May 20, 2019, 11:28 p.m.