Have you ever tried to find a lightweight yet nice theme for the R Markdown documents, like this page? Themes for R Markdown With the powerful rmarkdown package, we could easily create nice HTML document by adding some meta information in the header, for example — title: Nineteen Years Later author: Harry Potter date: July 31, 2016 output: rmarkdown::html_document: theme: lumen — The html_document engine uses the Bootswatch theme library to support different styles of the document.
Continue reading

Using showtext in knitr

Thanks to the issue report by yufree and Yihui’s kind work, from version 1.6.10 (development version), knitr starts to support using showtext to change fonts in R plots. To demonstrate its usage, this document itself serves as an example. (Rmd source code) We first do some setup work, mainly about setting options that control the appearance of the plots. Notice that if you create plots in PNG format (the default format for HTML output), it is strongly recommended to use the CairoPNG device rather than the default png, since the latter one could produce quite ugly plots when using showtext.
Continue reading

Author's picture

Yixuan's Blog

Statistics, Programming, and …?