cleanrmd

Clean HTML R Markdown Documents

Updated: November 29, 2020
Version: 0.0.6

Garrick Aden-Buie

https://github.com/gadenbuie/cleanrmd

cleanrmd is…

A collection of clean R Markdown HTML document templates using classy-looking classless CSS styles.

Sometimes you want to create a simple HTML file from your R Markdown source. You want something small to share with collaborators. You want a simple, readable document that you can email or just push to the web.

cleanrmd gives you a small, responsive HTML file that works great with R Markdown and pandoc and doesn’t rely on classes for styling so that it works in practically any browser.

Just because cleanrmd doesn’t use classes doesn’t mean you don’t have to! Feel free to use these themes as a starting point to add your own style and customization.

It’s still R Markdown

This is an R Markdown document. (View the source for this file.) Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

R Code

mtcars <- mtcars[, c("mpg", "cyl", "wt", "qsec")]
summary(mtcars)
##       mpg             cyl              wt             qsec      
##  Min.   :10.40   Min.   :4.000   Min.   :1.513   Min.   :14.50  
##  1st Qu.:15.43   1st Qu.:4.000   1st Qu.:2.581   1st Qu.:16.89  
##  Median :19.20   Median :6.000   Median :3.325   Median :17.71  
##  Mean   :20.09   Mean   :6.188   Mean   :3.217   Mean   :17.85  
##  3rd Qu.:22.80   3rd Qu.:8.000   3rd Qu.:3.610   3rd Qu.:18.90  
##  Max.   :33.90   Max.   :8.000   Max.   :5.424   Max.   :22.90

Plots

You can also embed plots, for example:

plot(mtcars$wt, mtcars$mpg, col = mtcars$cyl, pch = 16)

Tables

knitr::kable(mtcars[1:6, ], caption = "A subset of mtcars")
A subset of mtcars
mpg cyl wt qsec
Mazda RX4 21.0 6 2.620 16.46
Mazda RX4 Wag 21.0 6 2.875 17.02
Datsun 710 22.8 4 2.320 18.61
Hornet 4 Drive 21.4 6 3.215 19.44
Hornet Sportabout 18.7 8 3.440 17.02
Valiant 18.1 6 3.460 20.22

Headers (Header 2)

Header 3

Header 4

Header 5

Header 6

Block Quotes

We know from the Markdown syntax that paragraphs that start with > are converted to block quotes.

“If it weren’t for my lawyer, I’d still be in prison. It went a lot faster with two people digging.”

— Joe Martin

“Great people talk about ideas, average people talk about things, and small people talk about wine.”

— Fran Lebowitz

Images

Is it safe to come out yet? Photo by Mikhail Vasilyev on Unsplash.

Lists

Lorem ipsum dolor sit amet consectetur adipiscing elit torquent posuere penatibus ullamcorper, primis feugiat gravida risus phasellus placerat duis blandit elementum cubilia, mus porta ante fringilla etiam condimentum consequat imperdiet quisque netus.

Mattis varius conubia ornare turpis interdum laoreet, duis iaculis torquent purus ut id, parturient aptent luctus curae vel. Odio blandit dis proin quis ullamcorper sapien imperdiet lacus, neque per eros a posuere donec mauris purus, cursus potenti et auctor himenaeos aliquet diam.

  1. Lorem ipsum dolor sit amet consectetur, adipiscing elit pretium.
  2. Habitant interdum egestas pellentesque pharetra rutrum, ornare nisi netus luctus.
  3. Euismod convallis rutrum fermentum sodales hac, magna tristique mollis lacinia.
  4. Habitant nisi orci ad imperdiet sollicitudin, eu egestas sociosqu.