Rob McDonnell:Blog
About
Categories
All
(41)
Bayesian stats
(1)
IRT
(3)
MCMC
(2)
R
(5)
Stan
(3)
blogging
(2)
dataViz
(17)
docker
(1)
economics
(3)
gatsby.js
(1)
modelling
(2)
package management
(1)
political science
(7)
politics
(2)
python
(2)
rmarkdown
(3)
webscraping
(2)
Uk Elections 2024
political science
Well I did say I’d do another one of these come the next UK election, so here goes. The official data won’t be published until Friday the 12th of July but we can use our…
Jul 5, 2024
How wet was winter 2023/2024?
I’m back! It’s been years since I blogged on here. There are many reasons for that, being busy is a big one, kid, job etc.Getting a new laptop recently has renewed my…
May 4, 2024
modelscript
modelling
{modelscript}
is a little RStudio add-in I wrote to help me with modelling. I’ve been testing out the tidymodels framework for R (fantastic, btw) and I thought it would be…
Jun 8, 2020
What do the mtcars actually look like?
dataViz
It popped into my head the other day that I had no idea what most of the cars in the mtcars dataset look like. Some Google image searches later, I had a folder of them (you…
May 2, 2020
Render RMarkdown Code Chunks Based on Output Document Type
rmarkdown
RMarkdown users – did you know you can render code chunks based on the type of output you want to produce? It’s even easy-peasy 🤓
Apr 26, 2020
From R to Gatsby
gatsby.js
blogging
I don’t use Gatsby or JavaScript for this blog anymore, but this post is here for posterity anyway.
Mar 12, 2020
Images as column headers in R
dataViz
Have you ever wanted to include an image as a column header in a data frame? Of course you have!
Mar 1, 2020
One liner to show all colours available in R
dataViz
Some years ago, I came across a great little repo that contained R code to display all the colours available in R. You can source it as so:
Feb 28, 2020
Using Docker for Data Science
docker
R
python
In this post, I’ll go through a few examples of how you can use Docker for data science, from running a simple script to making reports. It’s based on real usage, so I think…
Feb 8, 2020
Brazilian Legislative Data with congressbr
dataViz
political science
Recently, a paper by myself and two friends was published in the Latin American Research Review (you can read it here). As we write in the paper:
Jan 17, 2020
UK Elections 2019
political science
dataViz
After the UK elections in 2017, I posted about how easy it was to plot the results in R. Given that the UK just had another election, I thought I’d update that post with…
Dec 13, 2019
Easily Use Python and R together with {reticulate}
R
python
I work in an environment where R and Python are used interchangeably, and most of the data scientists here have some familiarity with both languages. We regularly use one…
Nov 27, 2019
Taking RStudio’s renv for a spin
package management
I’ve been working on a project recently where we’ve been building a data analysis pipeline that involves bits of R code and bits of Python. Since the whole thing runs on…
Aug 17, 2019
Improving your DataViz
dataViz
import SimpleBarChart from “../graphs/SimpleBarChart.js” import data from “../data/divorceTurnout2019.json”
Jul 23, 2019
Visualizing the Irish Divorce Referendum in R
dataViz
politics
A while ago, I wrote a blog post on visualizing the results of the UK elections in 2017 (quite a while ago!). After the Irish elections and divorce referendum on Friday…
May 27, 2019
Shuffling Strings in R
R
Let’s say you need to share some data that has some potentially identifiable sensitive information in it – people’s addresses, phone numbers etc. Maybe these fields are not…
May 14, 2019
Avoiding the tiresome training & test data split
modelling
I really don’t like splitting data into ‘train’ and ‘test’. I don’t mean that I’m against the idea of it, though you could say it’s a waste of data that could be used to…
Sep 3, 2018
Mapping Economic Partners with flagfillr
dataViz
economics
🇨🇨 🇨🇽 🇵🇹 🇩🇴 🇫🇲 🇰🇷
Feb 10, 2018
Stan IRT Code
IRT
Stan
(
This turned out to be a bit of a ramble, for the code go here
😄)
Jan 5, 2018
Customize Interactive R Visuals in Power BI
dataViz
Some of us, through no fault of our own, have to work with things like Power BI. While it’s a powerful application, it’s just a little…you know. For anybody who works with…
Dec 1, 2017
Gauge-style plots with ggplot2
dataViz
I’ve been working on a project where the client wanted a “cockpit” style dashboard, with meter/gauge/speedometer type things. Even though this wasn’t likely to be…
Oct 24, 2017
UK Elections 2017
political science
dataViz
This post is a quickie to show how we can visualize the UK election results with just a few lines of R code. (Really, very few).
1
Sep 27, 2017
Analyzing Prison Data in R
dataViz
political science
My good friend Danilo Freire and I have just finished a little R data package, called prisonbrief. We hope that it will be useful for R users, particularly researchers in…
Jul 28, 2017
TFW you have to copy and paste something into R…
R
From time to time, you might need to copy and paste something into R and turn it into a character string. Maybe it’s something from the output of an error message, or from…
Apr 22, 2017
Update R from inside R
I was just about to update R a while ago when I thought to myself that there must be a way to do this inside of R (RStudio, I mean). A quick Google search brought me to the i…
Mar 16, 2017
No matching items
1
2