<p>My <a href="http://f.briatte.org/r">collection of R notes</a> is now slightly over one year old. This note reflects on how useful the exercise of blogging about R has been so far, and answers some of the questions that I have received about it.</p>
<h2>Blogging about R</h2>
<p>I created my collection of R notes with the intention to keep track of technical notes that I often need to refer to when I work with other people.</p>
<p>My notes are usually very simple, at least at the mathematical level: my math skills are “read-only” skills, and I have nothing of interest to “showcase” in that area. Still, most of my R notes are more technical in nature than the kind of blog posts that I write for <a href="https://politbistro.hypotheses.org/">my academic blog</a>, which I write in French for an audience of social scientists.</p>
<p>Writing up “R / Notes” has forced me to simplify the code that I use. My impression is that, when I write code for others to read through, I like to streamline the code as much as possible, using <a href="https://cran.r-project.org/web/packages/magrittr/index.html">pipes</a> and as few R packages and lines of code as possible.</p>
<p>I also have the habit to use single-letter names for objects and to create as few of these objects as possible, but that is probably as much of a bad habit as a good one. I can trace that habit to many years ago, when I used to write <a href="https://en.wikipedia.org/wiki/TI-BASIC">TI-BASIC</a> code in high school…</p>
<h2>R-Bloggers syndication</h2>
<p>As the header of <a href="http://f.briatte.org/r">this collection</a> suggests, my R notes are syndicated on the <a href="https://www.r-bloggers.com/">R-Bloggers</a> aggregator, where most other existing R blogs are also syndicated.</p>
<p>Thanks to <a href="https://www.talgalili.com/">Tal Galili</a> for maintaining R-Bloggers, and for his help with syndicating this blog despite the fact that it is built on a customized version of the (discontinued?) <a href="https://github.com/Circa75/dropplets">Dropplets</a> static blog engine that produces slightly weird <a href="http://f.briatte.org/r/atom">Atom</a> and <a href="http://f.briatte.org/r/rss">RSS</a> feeds.</p>
<h2>Code embeds</h2>
<p>One question that has come up more than once about this collection of notes is: How do I embed the R code that shows up in the notes?</p>
<p>The answer is that I use <a href="https://gist.github.com/">Gist</a>, with a short bit of custom CSS to hide everything produced by its <a href="https://github.com/blog/122-embedded-gists">embed</a> method, except for the code and its line numbers:</p>
<p>The little bit of CSS code above corresponds to <a href="https://gist.github.com/briatte/cccefd51b08e77319a0c8f36b733f92a">this (secret) Gist</a>. The code to embed the Gist, which requires JavaScript, is shown at the top of the Gist.</p>
<h2>Math embeds</h2>
<p>Another question that has come up about this collection of notes is: How do I embed the math code that (occasionally) shows up in the notes?</p>
<p>In order to be able to use mathematical notation in some of my notes, I have turned, like many others, to the fantastic <a href="https://www.mathjax.org/">MathJax</a> library, which brings the power of <a href="https://en.wikipedia.org/wiki/LaTeX">LaTeX</a> typesetting to the Web.</p>