Hello World

So this is just your basic “hello world” post. I’m testing my workflow for writing blog posts, which I hope will be…

  • write posts using R Markdown
  • knit to MD
  • commit to GitHub
  • host with github.io

R Markdown

This post is an R Markdown document. 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.

With R Markdown, I can display and execute chunks of R code.

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

This greatly increases the reproducibility of the blog posts because the analysis code and the blog post are all in the same document. The code doesn’t have to be copied from R and pasted into an HTML file. That would make it possible (perhaps even likely) that my R code and results would get out of sync with the results I’m describing in the blog post. By putting the code right in the blog post, the two will stay synched up.

Plots

Not only can these blog posts show the output of R code, they can also show plots!

plot(pressure)

knitr

Using the knitr package by Yihui Xie, the R Markdown post can be transformed to standard Jekyll markdown. I’m using a (slightly) modified version of the workflow process created by Nicole White. I made some slight modifications to the r2jekyll.R that she developed. Like everything else associated with the creation of this blog, you can find this file in my GitHub repository.

Jekyll

The last component of the pipeline is Jekyll, a Ruby bundle for creating a blog site from static files. These files are shared on github.io.

UPDATE! (2/4/2017)

So I got all of this set up… learning to use Jekyll and getting R Markdown to play nice with it. Then I learn that Yihui Xie has just released a new tool called blogdown that simplifies the process of converting R Markdown to a blog post. However, his new tool is using Hugo as the static website engine. Since I’ve already got all of this setup, I’m going to keep it. But if anyone else out there wants to use R Markdown for blogging, I would definitely recommend that you check out blogdown instead of following my path.

UPDATE AGAIN! (2/5/2018)

So here we are… one full year later. I haven’t done as much with this blog as I’d hoped, but I’ve recently been inspired to add some content. A lot has changed in the past year… including a new laptop. Since I have to create a new workflow for adding blog posts, I thought I should just go ahead and switch to blogdown. So that’s happening now.