Earlier in the year I made a decision switch my website to using
I've decided to close down my old blogger site and move on with website built by @xieyihui's blogdown package. It makes it so much easier to blog!!! Here's hoping I'll blog more this year. Here's the new site: https://t.co/nwqcvqjdMu— Emi Tanaka 🌾 (@statsgen) January 20, 2018
But there’s a new kid in town. His name is
radix. Ooh, hoo.
So how are
blogdown R packages different? Let’s first at a look why we want to consider blogging for scientific or technical content using R Markdown and then look at a comparison between the two R packages.
Why scientific or technical blog?
While I don’t wish to dictate what should constitute to be a scientific or technical blog (because I wouldn’t know where to draw the line), there are some blogs that provide large benefits to the scientific community. These could be blogs about technical use or tutorial of software which may not warrant a full-fledged academic article. I have personally benefited from many scientific and technical blogs.
Another benefit to blogging is that the author has control of the writing style. Scientific or technical articles usually call for formality while blogging is free from such obligation and allow the author to relax to his/her own style of writing. I particularly like authors that display a blend of humour or personal thoughts and experience that makes reading their blogs entertaining for me.
There is of course a downside to allowing anyone to blog in any style they like. Quality control. It is not hard for some people to make outrangeous scientific claims without any evidence. This of course doesn’t stop happening even with a rigorous scientific process (e.g. the well known case of the fradulent paper alluding that the vaccine causes autism). This is more of a lesson perhaps that it is important that each individuals train themselves with critical thinking.
Why R Markdown?
R Markdown, described briefly, allows you to use a simple syntax to seamlessly embed code and its output into documents. Contrary to the name, the code does not have to be R but support varying languages such as python, go, C and even SAS. For the full list see here.
R Markdown documents consist of all codes with the ability to easily hide the code (contained in the so-called chunks) for the desired output. The simplicity yet flexibility to customise makes R Markdown a powerful tool that makes it easy for users to adopt reproducible research and literate programming.
R Markdown is written by the team of software enginners in RStudio who have shown commitment to open source projects and work in a company that appears to have a viable business model. These two points as well as large community usage (shown by the increasing popularity in Figure 1) give some assurance to me that there will be a long term commitment to maintaining the R Markdown based R packages.
Radix or Blogdown?
A brief description of
blogdown are shown later. Table 1 shows a comparison of features between
A key selling point for me to use
radix was the metadata automatically generated that allows easier indexing for Google Scholar and automatic article citation generation. As a researcher, we are often required to show impact of our work for grant or promotion applications. This can be difficult to measure for a web post and consequently, a well-received and useful scientific or technical post do not even get the same recognition as a journal article that have contributed less to the scientific discussion or community. By making posts easily citable, I would hope that more recognition is given to web posts that have been helpful for scientific research and it would encourage more individuals to contribute positively to the scientific discussion.
Another point that
radix made it easy for beautiful and elegant writing is the ability to write side comments and customise figure layouts to stretch beyond the post margins. This is doable in
blogdown as well, however, it requires work for almost all themes.
It should be stressed that
blogdown is used to create a more general purpose website and it is possible to incorporate all features of
radix within the
blogdown framework. To implement this requires time and effort so most will find it easier to just use
radix for certain purposes. This may change in future though if someone capable can introduce it as a Hugo theme. Yes someone capable…
Someday I might write a Hugo theme based on the radix/distill style. I feel modern CSS frameworks are making things unnecessarily complicated, e.g. you don't really need the CSS grid layout to create a fullwidth element---two lines of native CSS could do that.— Yihui Xie (@xieyihui) December 7, 2018
|Github Repo Creation Date||2018-04-23||2016-11-02|
|For general purpose blogging|
|Many themes available||✘||✔|
|Adding date and author for posts||✔||✔ for most theme.|
|Easy structure customisation||✘||✔ depending on the theme.|
|Adapts to different screens||✔||✔ for most theme.|
|For scientific/technical writing|
|BibTeX citation easily works||✔||✘|
|Adding affiliation||✔||✘ easy to add but some fiddling needed for almost all theme.|
|Customise figure layout||✔||✘ fiddly if going over post margin.|
|Side comments (Tufte style)||✔||✘|
|Popup notes easily works||✔||✘ works with some fiddling.|
|Metadata for Google Scholar||✔||✘ can be added with some work.|
|LaTeX easily works||✔||✔|
radix is a new R package, that is based on the Distill web framework to bring scientific or technical writing using R Markdown that is native to the web. The Distill web framework is used in the Distill Research Journal which publishes research on machine learning. More details about
radix are well explained here. The
radix framework is shown as a chart in Figure 2.
blogdown is an R package that uses Hugo in the backend to generate the website.
blogdown also can use Jekyll or Hexo as the generator in place of Hugo however some features are only supported in Hugo. While the package name signifies that the primary motivation is for blogging,
blogdown is not limited to blogs and is flexible to create any website. Details about the
blogdown package is best explained in the book by Xie et al. (2017). The
blogdown framework is shown as a chart in Figure 3.
With an explicit (but optional) entry for affiliation in
radix, users are consciously reminded that their blog posts may also reflect upon their affiliation’s reputation and approach their writing with more seriousness and formality. Additionally,
radix is built with scientific and technical writing in mind, thus, the format is more rigid, allowing for more consistency, and have a default set up and features convenient for this purpose (e.g.
echo=FALSE as default for the chunks and side comments, etc). These features reduce the friction for the user to produce a beautiful scientific or technical web article.
It is possible to create a Hugo theme that mimics the
radix output therefore there is no reason the more general purpose
blogdown cannot be used for scientific or technical writing to achieve a similar output as
radix. Of course this requires someone to create the theme and there isn’t a closing matching theme at the moment.
R Markdown documents are usually used to populate the content for websites generated from both
blogdown therefore it would be easy to transition between the two packages albeit requiring some work. Perhaps one day someone will write an article on how to achieve this with minimal work.
blogdown? This is ultimately up to you. One thing I’m sure is that writing articles using R Markdown documents has aided greatly in my scientific writing.