matrix_to_latex: Function converts numeric/character matrix or data frame to...

View source: R/matrix_to_latex.R

matrix_to_latexR Documentation

Function converts numeric/character matrix or data frame to Latex format

Description

Function returns a Latex formatted matrix for Rmarkdown documents.

Create the Latex string by calling the function: A_matrix_str = matrix_to_latex(A). The matrix string could then be used directly in a Rmarkdown document, surrounding latex "$" signs included.

Usage

matrix_to_latex(
  x = NULL,
  bracket_type = "bracket",
  small_inline = FALSE,
  fractions = FALSE,
  digits = 2,
  matrix_name = NULL,
  centered = FALSE
)

Arguments

x

A numeric/character vector, matrix, data frame.

bracket_type

A string that set the bracket type. Acceptable values are "none", "bracket", "paren", "curly_bracket", "verts", "double_verts".

small_inline

A logical which if TRUE creates an inline small matrix.

fractions

A logical which if TRUE will express non-integers as rational numbers.

digits

The number of rounded digits for the numeric values.

matrix_name

A string that sets the name of the matrix.

centered

A logical which if TRUE creates Rmarkdown that centers the matrix.

Value

A string of inline Rmarkdown

Author(s)

Rick Dean


deandevl/RmatrixPkg documentation built on March 11, 2023, 2:39 a.m.