knitroff-package: Dynamic Reports in troff with knitr

knitroff-packageR Documentation

Dynamic Reports in troff with knitr

Description

Write a report in troff with the ms macros and put R code in it between .SS and .SE. knit_roff runs the code; render_roff typesets the result with GNU groff as a PDF, a PostScript file, or a draft for the terminal. The design follows troff's preprocessors, eqn and tbl, which each found their own blocks in a document and passed the rest through: here, one more preprocessor at the front of the pipeline, which runs R.

In RStudio, the Addins menu has Insert troff chunk and Render troff document, which stand in for Insert Chunk and the Knit button in .Rms files. Give them keys in Tools > Modify Keyboard Shortcuts. They need the rstudioapi package.

See Also

The reference for writing documents: ms (the ms macros, such as ⁠.PP⁠), troff (requests, escapes, units and special characters), eqn (equations) and tbl (tables).

The example report: system.file("examples", "states.Rms", package = "knitroff").


knitroff documentation built on Oct. 16, 2026, 5:09 p.m.