export_to_latex: An Export Function to produce a LaTeX table

Description Usage Arguments Value Examples

Description

Exports the R data object into a tex file with the same name as in the R working environment (into the current working directory). Automatically detects integers, strings, and numerics automatically formatting accordingly as string or numerical (with significant figures). Allows formatting of spaces in rownames.

Usage

1

Arguments

x

Data matrix or Data Frame to be exported into a tex table.

Value

\begintable[ht] \centering \begintabularrrll \hline & c.1..2..3. & c..A....B....C.. & c.T..F..T. \\ \hline 1 & 1 & A & TRUE \\ 2 & 2 & B & FALSE \\ 3 & 3 & C & TRUE \\ \hline \endtabular \endtable

Examples

1
2
3
4
5
6
7
8
data <- matrix(rnorm(500), 50, 10)
rownames(data) <- 1:50
colnames(data) <- letters[1:10]

export_to_latex(data)

example <- cbind(c(1,2,3), c("A", "B", "C"), c(TRUE, FALSE, TRUE))
export_to_latex(example)

TomKellyGenetics/R2LaTeX documentation built on May 9, 2019, 4:52 p.m.