R Markdown and prettydoc

The Architect Theme

Harald Schilly

2018-09-17

Info

This is taken from http://yixuan.cos.name/prettydoc/ showcasing the “Architect” theme. Derived from work by Yixuan Qiu.

Headers

Level 4

Level 5

A demo table

Df Sum Sq Mean Sq F value Pr(>F)
Block 5 343.3 68.66 4.447 0.01594 *
N 1 189.3 189.28 12.259 0.00437 **
P 1 8.4 8.40 0.544 0.47490
K 1 95.2 95.20 6.166 0.02880 *
N:P 1 21.3 21.28 1.378 0.26317
N:K 1 33.1 33.14 2.146 0.16865
P:K 1 0.5 0.48 0.031 0.86275
Residuals 12 185.3 15.44

Lists

There are three kinds of lies:

  1. Lies
  2. Damned lies
  3. Statistics
  • Frequentists
  • Bayesian

Supported highlighters in prettydoc:

  • github: Style similar to Github
  • vignette: Style used by rmarkdown::html_vignette

Markups

Bold, italic, don’t say this.

Code

Familiar knitr R code and plots:

n <- 1000
x1  <- matrix(sort(rnorm(n, mean = 2, sd = 2.5)), ncol = 2)
x2  <- matrix(rnorm(n, mean = 2.5, sd = 2.5), ncol = 2)
x   <- rbind(x1, x2)
smoothScatter(x, xlab = "x1", ylab = "x2")

head(x)
##           [,1]     [,2]
## [1,] -6.780153 2.073663
## [2,] -5.932116 2.075640
## [3,] -5.114294 2.081617
## [4,] -5.077919 2.088418
## [5,] -5.026488 2.099158
## [6,] -4.725300 2.128005

Data Frame visualized via knitr::kable

knitr::kable(head(data.frame(x1=x1, x2=x2)))
x1.1 x1.2 x2.1 x2.2
-6.780152 2.073663 2.232933 1.814658
-5.932116 2.075640 2.177151 1.787197
-5.114294 2.081617 6.026179 6.774026
-5.077919 2.088418 6.489843 1.029529
-5.026488 2.099158 -4.571437 1.117070
-4.725300 2.128005 3.210092 3.580132