transeq: Export the transformation equation into LaTeX

Description Usage Arguments Details Examples

View source: R/transeq.R

Description

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

Usage

1
2
3
4
5
6
7
transeq(obj, digits = 4)

## S3 method for class 'sb'
transeq(obj, digits)

## S3 method for class 'su'
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

1
2
3
4
5
6
7
8
9
## 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)

wangyuchen/jtrans documentation built on May 4, 2019, 12:58 a.m.