View source: R/knit_print.formula.R
knit_print.formula | R Documentation |
Generate LaTeX math from an R formula
## S3 method for class 'formula'
knit_print(x, inline = TRUE, replacements = list(), ..., width = 80)
x |
A formula |
inline |
Should the formula be generated for use inline or as a separate line? (In LaTeX notation, with "$" or "$$".) |
replacements |
A named list where whenever the list name is seen as the text for any complete part of the equation, it is replaced with the value (which should be a LaTeX equation fragment). |
... |
Currently ignored |
width |
Approximate number of characters for splitting to multiple lines. (Not yet implemented.) |
A knitr asis_output()
formula
knit_print(a~b)
# The same with an equal sign
knit_print(a~b, replacements=list("\\sim"="="))
knit_print(a~b/c)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.