Bookdown is an eBook authoring platform for R programmers. It's based on two R packages - knitr and rmarkdown - along with Pandoc. It's usually invoked from the open-source RStudio IDE.
Features:
Creates a GitBook-like or Bootstrap-themed static website for an eBook
Can create PDF eBooks using the full power of LaTeX
Can create EPUB eBooks via Pandoc
Can insert output from code chunks into output website / eBooks