7.7
R Lexer
(require r-lexer) | package: r-lexer |
The R and R-block forms are used for typesetting R code.
Similar to the code function.
Parses R code from strings into the inline text of the document.
For example,
This is @R{1 + 2}.
produces the typeset result:
This is 1 + 2.
str-expr is a list of strings representing R code.
Similar to the codeblock function.
Parses R code from strings into a block in the document.
For example,
@R-block|{ f <- function (x) { if (f <= 1) 1; else x*f(x-1); } }|
produces the typset result:
f <- function (x) { if (f <= 1) 1; else x * f(x - 1); }
str-expr is a list of strings representing R code.