Publications by David Selby

Secret Santa in R

07.12.2016

Our office just exchanged presents for Secret Santa, a tradition where each person is randomly assigned someone else to give an anonyous gift. One of the challenges of Secret Santa is keeping the pairs of gift-givers and receivers both random and secret. How can you do this while also taking part yourself? Using R, of course! Firstly, recruit peo...

3235 sym R (1427 sym/8 pcs) 2 img

Deploying an R Markdown Jekyll site to GitHub Pages

16.06.2017

GitHub Pages’ built-in Jekyll support makes it very easy for techie types to deploy static web sites. Simply push your plain text Markdown content to a repository and the server-side Jekyll engine will render it for the web. Markdown is good, but R Markdown is even better, assuming we ever want to write anything involving plots or data analysis...

7533 sym R (786 sym/8 pcs)

Pretty errors, warnings and messages in R Markdown

18.06.2017

When knitting an R Markdown document to HTML output, R chunks can produce warnings, errors or messages. Normally these messages look like any other console output: Pretty ugly, and usually something I find myself trying to hide at the earliest opportunity. But if you’re using R Markdown’s default template, which uses Twitter Bootstrap, you c...

1255 sym R (651 sym/2 pcs) 4 img

Publishing from blogdown to GitHub with Travis

22.06.2017

Yihui Xie’s new blogdown package is a brilliantly elegant and simple tool for creating R-themed blogs and web sites. Starting your own blog is as simple as one line of R code: blogdown::new_site() By default, blogdown uses Hugo, a static web site generator written in Google’s Go programming language. This has a number of advantages over Jeky...

4525 sym R (586 sym/6 pcs) 8 img

Chernoff faces in ggplot2

25.06.2017

I am pleased to introduce my first R package for general consumption, ggChernoff. Inspiration stems from Leland Wilkinson’s book, The Grammar of Graphics, whose principles were later implemented as the layered grammar of graphics in Hadley Wickham’s popular R package, ggplot2. Wilkinson’s grammar generalises data visualisation. Rather than ...

3368 sym 10 img 1 tbl

useR! poster: ranking influential communities

29.06.2017

Next week I will be presenting a poster at the useR!2017 conference in Brussels. My topic is Ranking influential communities in networks. Using a large dataset of citations from the Web of Science, we grouped academic journals into communities based on their citation behaviour. These communities closely correspond to recognisable research fields,...

1594 sym 2 img

Using R on Android

29.12.2017

I just discovered a way to get R running on my smartphone, with full support for packages, graphics and R Markdown, and no need to connect to an external server. This is really handy for quickly checking R code, trying out ideas and writing blog posts on the go. It works quite well! Here I will show you how to do the same on your Android device. ...

5257 sym R (1037 sym/17 pcs) 12 img

Building a neural network from scratch in R

09.01.2018

Neural networks can seem like a bit of a black box. But in some ways, a neural network is little more than several logistic regression models chained together. In this post I will show you how to derive a neural network from scratch with just a few lines in R. If you don’t like mathematics, feel free to skip to the code chunks towards the end. ...

17007 sym R (6271 sym/17 pcs) 16 img 1 tbl

Exploring influence in networks

07.03.2018

I have just published an interactive graphic showing the effect of ranking scientific communities with pairwise comparison models. The visualisation is an interactive version of my (award-winning) useR!2017 poster, Ranking influential communities in networks. You can see how academic journals have been grouped into communities based on their cita...

1948 sym

R code golf: the identity matrix

27.03.2019

How many different ways are there to create an identity matrix in R? This was an interesting little challenge set by Guillaume Nicoulaud on Twitter. Find as many way you can to create the identity matrix with #rstats. pic.twitter.com/HlhIM6mSrx— Guillaume Nicoulaud (@ordrespontane) February 3, 2018 In code golf, programmers try to write an algo...

5936 sym R (2960 sym/19 pcs)