Useful links for mapping in R

Geography was not my favourite subject as a high-schooler: maybe having a teacher who smoked a pipe in the classroom had somethiing to do with that. In fact, I swiched to Ancient Greek as an option as soon as I could: it was that bad However, for some time I have loved early maps and have this one (regrettably not the original) on my wall at home

Recently I have been captivated at how modern ones can be used for socio-economic analyses with leading publications such as the Economist and 538 regularly producing maps using open data in their articles.

Read more

Share Comments

First look at Tidycensus

The whole future of the US census has been coming under scrutiny recently, but, thankfully, we are getting more tools to scrutinise both its decennial data and that of its sister-source, the American Community service (ACS). Specifically, Kyle Walker’s tidycensus and tigris packages which return data-frames (including shape-files as list-columns, if required) from the census API and Edzer Pebesma’s sf, simple features, package

Read more

Share Comments

Get me to the church on time

2017 seems to be the ‘Year of the Map’. The simple features, sf package is and will continue to have a great impact and the recent release of leaflet.extras adds some glitz to the leaflet package Added to this list can be rmapzen which is a client for the Mapzen API. Author, Tarak Shah has provided an introduction to his work-to-date and I have leant on that heavily in this post to create contour maps.

Read more

Share Comments

Baby Names in the UK and USA

Lost in the realms of time when reshape2 and ggvis were flavour of the month (i.e 20 months ago), I apparantly created a shiny app built around Hadley Wickham’s babynames data package With the recent release of a UK equivalent from Thomas Leeper and an intriguing plot on tennis world ranked number ones, I have decided to play around with the data both old and new

Read more

Share Comments

Ages by England & Wales constituency

There is are a lot of opportunities for data visualizations in journalism and R is beginning to get a toehold in this arena I recently came across a for-loop tutorial from the R for journalists blog and decided to reprocess it using tidyverse packages whilst adding a plot and map The article uses some GB office of National Statistics data to calculate the estimated mean age of the population of each of the England and Wales parliamentary constituencies

Read more

Share Comments

Theme Update

Yow will have noticed a new look to the site, now based on the Hugo Icarus theme The major reason for introducing this is that the previous theme I used was unable to render certain htmlwidgets I wanted to use to illustrate my code. The code may also be a bit more legible For those of you interested in creating a similar styled blog, please refer to Yihui Xie & Amber Thomas’s detailed documentation and a useful blog post by Ed Borasky on setting up a similar-themed site

Read more

Share Comments

Integrating dplyr with Remote databases

A recent RViews article covers the use of the dplyr package to interact with SQL databases All the code can be written in R, which dplyr then translates into SQL queries to harness the power of a database You will probably want to read the article if interested in extending the process to your own data but here is a taster from some of mine

Read more

Share Comments

RcppRoll package for swift moving averages

Bob Rudis always keeps his pulse on the best packages and recently bemoaned the fact that Kevin Ushey’s RcppRoll package which Provides Routines for the efficient computation of windowed mean, median, sum, product, minimum, maximum, standard deviation and variance are provided. has not had enough praise One reason is probably the lack of examples available - even in the vignette I have therefore done a swift illustration using just one of the functions, roll_sum()

Read more

Share Comments

What's News?

newsflash package Polymath, Bob Rudis (aka hrbrmstr) has recently released the newsflash package which is a “set of tools to Work with the Internet Archive and GDELT Television Explorer”" In a recent blog post, based on a gdelt project creator article, he details the coverage of Hillary Clinton’s email server woes, with the, unsurprising, fact that FOX News spent more time on the issue than other broadcasters

Read more

Share Comments

UK 2015 Election Mapped

Just providing a quick update to the previous post. Since that was done a few weeks ago, Evan Odell has been doing some great work on enhancing his Hansard package details of which you can view here. I plan to do some more work on this incredible resource in the future but for now am just looking at some mapping. This entails using the sf package for the first time - one which the experts are saying is going to have big impact on R development and a spot more purrr (which is part of the tidyverse environment)

Read more

Share Comments