| knit_roff | R Documentation |
Runs the R code of a troff document and writes plain troff, ready for GNU groff with
the -ms macros. Code chunks sit between .SS and .SE, the way
eqn blocks sit between .EQ and .EN; chunk options follow
.SS, as in .SS scatter, fig.cap="Income", echo=FALSE. Inline results are
written `r expr`, and .SR name expr defines the troff string
\*[name] with the value of expr.
knit_roff(input, output = NULL, format = c("pdf", "ps", "utf8"), highlight = TRUE,
quiet = TRUE)
input |
Path of the document, usually ‘.Rms’. |
output |
Path of the troff file. By default |
format |
What the troff is for: |
highlight |
Set R keywords in bold and comments in italic, in the
constant-width bold and italic fonts, as printed listings did. |
quiet |
Passed to |
Each chunk becomes one listing in a constant-width font: the code with > and
+ prompts, its output under it, kept together on a page. Figures are written to a
directory named after the document. knitr's patterns, hooks and options are restored
afterwards. No groff is needed to knit.
The path of the troff file, invisibly.
render_roff to typeset the result, roff_table.
doc <- file.path(tempdir(), "mean.Rms")
writeLines(c(".PP", "The mean of 1 to 10 is `r mean(1:10)`.",
".SS", "x <- 1:10", "summary(x)", ".SE"), doc)
cat(readLines(knit_roff(doc, format = "utf8")), sep = "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.