Learn R Programming

jtrans (version 0.2.1)

transeq: Export the transformation equation into LaTeX

Description

transeq turns a jtrans object into a LaTeX equation for display.

Usage

transeq(obj, digits = 4)
"transeq"(obj, digits)
"transeq"(obj, digits)

Arguments

obj
a jtrans object with a specific transformation type
digits
digits displayed in the equation

Details

A LaTeX equation in the display mode, e.g. between \[ and \] is returned with the formula used in the transformation. Note that when it's displayed in the R console, the backslashes are escaped. So it's always double backslash when in print it in the terminal.

This is designed to work with knitr and rmarkdown. In this case you can set the chunk option results='asis' and output it to a PDF document. Then the LaTeX equation will be properly formatted and can be easily included in your report.

Examples

Run this code
## Not run: 
# # designed to be used with R Markdown and chunk options
# ```{r, results='asis'}
# library(jtrans)
# jt <- jtrans(rexp(30, .3))
# transeq(jt)
# ```
# ## End(Not run)

Run the code above in your browser using DataLab