This R package provides ready-to-use HTML output formats and templates for RMarkdown documents. The goal is to produce clean documents "out of the box", with or without the RStudio IDE. This package provides templates that are tailored for Fred Hutch.
This package is forked from
rmdformats R package and currently only adds minor tweaks. See the original package for full details and implementations for a variety of templates.
The package provides several HTML output formats.
Format taken from the
rmdformats::readthedown. Originally adapted from the corresponding
readtheorg theme of the org-html-themes project, fully responsive with dynamic table of contents and collapsible navigation.
Features and helpers
Some extra features are available depending on the format :
hutchthedownis fully responsive, with collapsible navigation
The package also provides a
create.doc() function as well as RStudio document
templates to easily generate an empty and ready to use rmarkdown file with
several configuration directives.
Finally, it also provides the
pilltabs() helper function, which allows to display a crosstab dynamically.
install.packages(devtools) # if necessary devtools::install_bitbucket("robert_amezquita/hutchtemplates")
Creating a new document
New File... >
R Markdown..., then select
You should then be able to create a new document from one of the package
create.doc() function allows you to create a new directory with a clean
ready-to-use RMarkdown file.
create.doc() gets two main arguments :
dirnameis the name of the folder and RMarkdown file to be created
formatis the format name (
By default, a
Makefile file will be created in the new folder for direct
rendering from the command line.
Rendering from within RStudio should be quite simple : just click the
Rendering from R
You can render your document into HTML directly from within R with the
render() function from the
rmarkdown package :
Rendering with the Makefile
If you created your
.Rmd file with the
create.doc() function, you can then
generate HTML or PDF files with :
make html make pdf
You can also clean out any generated files and cache with :
- Magnific popup lightbox plugin
- The code of
create.doc()is heavily inspired by the
create.project()function of the ProjectTemplate package
readthedownis adapted from the corresponding
readtheorgtheme of the org-html-themes project, which is itself inspired by the Read the docs Sphinx theme.