Making A Blog Site with RStudio, R Markdown and Blogdown Part I

This blog is made of one philosophy resting on four pillars: it should cost exactly nothing and all the software you need are the following.

  1. The R programming language for data analysis.

  2. The R Markdown language for content generation and typesetting.

  3. Blogdown in conjunction with Hugo to generate the web pages.

  4. Github-Pages for webhosting.

This post will mainly touch on 1 and 2. Part II will focus on 3 and 4 so you can get your own blog up and running if you want to follow in my footsteps.

The R Programming Language

R is a programming language designed for statistical computation. It has very powerful data manipulation and 2d plotting capabilities. However to use it to its full potential you need to let go of graphical user interfaces and start writing R scripts. If you have always relied on GUI before, you should know that having to code everything is a good thing! Imagine having to explain to someone which buttons to click and how far he has to move the slider to get the same result you have. If you did everything in R all you need to do is just showing them the code.

To get R up and running on your computer, download and install the R distribution for your operating system from the official website

R Markdown

Perhaps the most important reason to create a blog site this way is none other than R Markdown. You can think of R Markdown as a language that allows you to quickly generate decent looking webpages with embedded R codes, graphics and even \(\LaTeX\) expressions for mathematical equations. It is an incredibly efficient language in the sense that almost every single thing you type goes directly to the content you want to show to your audience as opposed to tweaking various display or formatting parameters.

I use the popular RStudio to write R Markdown files. Be sure to install R first if you haven’t done so already.

Once you have RStudio installed go ahead and launch it. Type the following lines in the console to install all the packages you need for R Markdown:

install.packages('rmarkdown')

I won’t go into how to use RStudio or write R Markdown files here because there are many excellent tutorials on the subject already. The reason I bring them up is because there are nice tools out there that help us convert content generated by R Markdown to content readable on a blog like this one. Part II will talk about how to set up free webhosting using Github-Pages and configure Blogdown and Hugo to generate the static webpages for the blog site.

Keh-Harng Feng avatar
About Keh-Harng Feng
Keh-Harng Feng is aspiring to become a data scientist. He graduated from York University with a MSc in Physics and University of Toronto with a BSc in Computer Science and Physics.
comments powered by Disqus