Written by developers of R Markdown, this cookbook is a collection of short, practical examples for getting more out of R Markdown documents. It grew out of feedback that the earlier R Markdown: The Definitive Guide, while thorough, could make it hard to figure out how to accomplish a particular task. Many recipes draw on popular Stack Overflow questions, blog posts, and tutorials, gathered into one place with up-to-date solutions.
The book is recommended for new and intermediate R Markdown users. Newcomers will find quick answers to the problems people run into most often, while regular users will discover lesser-known features, customization options, and new ways to apply the software. The book predates Quarto, but many recipes also work in Quarto documents that use the knitr engine.
Topics include how to:
- Add citations, cross-references, diagrams, and dynamically generated text
- Control formatting and layout with Pandoc Markdown, custom CSS, and LaTeX or HTML templates
- Customize LaTeX, HTML, and Word output, including custom Word templates
- Create and style tables with
knitr::kable()andkableExtra - Fine-tune code processing with chunk options, output hooks, and chunk hooks
- Speed up and organize work with caching, child documents, and reusable code chunks
- Run Python, shell scripts, SAS, Stata, and other languages alongside R
- Streamline workflows with parameterized reports,
rmarkdown::render(), and project templates
Thanks to Chapman & Hall/CRC, the full book is free to read online.
