Learn R Programming

BioGeoBEARS (version 0.2.1)

pdftable: Print a table to LaTeX format

Description

This function prints a table to PDF via pdfit, which calls xtable and the LaTeX pdflatex function. It will only work if you have command-line LaTeX installed.

Usage

pdftable(table_vals, pdffn = "tmptable.pdf", size = "\\tiny", tmpdir = "~", openPDF = TRUE, caption = NULL)

Arguments

table_vals
A table, hopefully produced by conditional_format_table.
pdffn
The filename for the output PDF (and the prefix for the intermediate files).
size
Font size, overriding getOption("xtable.size"). Default is "tiny" (with backslashes). You can also try "small". Input NULL (without quotes or backslashes) for medium. (NULL is the options default.)
tmpdir
The location for the temporary files.
openPDF
If TRUE, open the PDF via a system command.
caption
A caption, if desired.

Value

pdffn The filename of the PDF file.

Details

This function was inspired by http://tex.stackexchange.com/questions/15013/generate-a-pdf-containing-r-output-inside-latex-table.

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

pdfit

Examples

Run this code
test=1

# Setup data
## Not run: 
# data = c(2.768443, 1.869964, 5.303702, 4.733483,  2.123816,
# 18.551051, 5.483625,  3.590745,  18.772389)
# result = matrix(data, nrow=3, byrow=TRUE)
# result = as.data.frame(result)
# names(result) = c("CV", "LCB", "UCB")
# rownames(result) = c("within", "between", "total")
# result
# pdftable(table_vals=result)#' ## End(Not run)

Run the code above in your browser using DataLab