Posts

I’ve patched rakeR on CRAN to v0.2.1 to fix a couple of problems in the examples and tests, which were using old labels and failing on some machines (thanks to Derek Atherton for the feedback). I’ve also updated the documentation website to use the new pkgdown template to be consistent with other R packages, most notably the tidyverse. And, that’s about it. If you’re using v0.2.0 and are happy there are no changes to the API to worry about.

CONTINUE READING

I am absolutely delighted to announce that the latest version of rakeR, version 0.2.0, is on CRAN. You can install it in R or RStudio with: install.packages("rakeR") DOI rakeR now has a DOI. This is probably more useful for me than it is for you but nevertheless, if you use rakeR please be sure to cite it and use the DOI: https://doi.org/10.5281/zenodo.821506 Changes and improvements Speed improvements in integerise() The most noticeable change is that the integerise() step, which previously took hours on a reasonable–sized data set, now takes minutes.

CONTINUE READING

I get this error so often (and I always forget how to solve it) that I thought I’d post a solution. Here’s the error: pandoc-citeproc: "stdin" (line 2421, column 2): unexpected "m" expecting "c", "C", "p", "P", "s" or "S" pandoc: Error running filter /usr/lib/rstudio/bin/pandoc/pandoc-citeproc Filter returned error status 1 Error: pandoc document conversion failed with error 83 The problem is that there’s an entry in my bibliography BibTeX file without a trailing comma:

CONTINUE READING

You need to build a URL to query the Google Places API, one URL per place. Judging by the Places API guide you need to: Get an API key Obtain a placeid from a places search, then Use this placeid to get information from the Place Details API. The base URL is: https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters JSON is the recommended output format, and we need to specify the following parameters:

CONTINUE READING

I recently had to review figures from nearly 50 countries for a project I’m working on. Each country had three figures that needed comparing. Anyone who knows me will know that I had had enough after loading figures for just the first few countries. Apart from being tedious it was also error–prone; double–click the wrong file by mistake and it’s not immediately obvious you’ve got the wrong figure. Instead of doing it manually and risking making mistakes I wrote the following small python script using the pillow library.

CONTINUE READING

A number of R spatial libraries have been updated in the last couple of weeks, and this has played havoc with my Travis-CI build. I had still been using Ubuntu Trusty with Travis which uses old versions of libraries like rgdal and rgeos, so I needed to move to updated versions of these. In addition sf has now become a dependency for a number of spatial packages like tmap, and this uses libudunits2-dev which isn’t installed by default.

CONTINUE READING

I recently gave a presentation for analysts and data modellers at the Department for Work and Pensions (DWP) introducing the spatial microsimulation technique (specifically the IPF flavour), and below are the slides I used (use spacebar to navigate through the slides): Alternatively you can download the presentation as a standard html file to open in your browser. Much of the content is based on material from Spatial Microsimulation with R by Robin Lovelace and Morgane Dumont (online content | physical book) and my own rakeR package for R.

CONTINUE READING

When you download geographical data the polygons are often highly detailed, leading to large file sizes and slow processing times. Often this detail is unnecessary if you’re not intending to produce small–scale maps. Most thematic maps, for example, tend to compare large geographies such as nations or regions, so the detail is unnecessary. Likewise, if you’re producing your map for use on the web, for example as an interactive visualisation, too much detail can slow the rendering and responsiveness of your app.

CONTINUE READING

On Saturday (24th September) I participated in the UK Data Service’s Open Data Dive Hackathon. The goal was to use open data to create an artefact or visualisation with the grand prize being the opportunity to have your artefact printed on one of MMU’s industrial 3D printers. I wanted to explore using a QGIS plugin called qgis2threejs to create 3D visualisations using the three.js javascript framework that allows you to render your visualisation in a WebGL-capable browser.

CONTINUE READING

I’m proud to announce the initial release of rakeR, v0.1.1, has been published on CRAN! It’s licensed under the GPLv3 so you can use it for any projects you wish. Purpose The goal behind rakeR is to make performing spatial microsimulation in R as easy as possible. R is a succinct and expressive language, but previously performing spatial microsimulation required multiple stages, including weighting, integerising, expanding, and subsetting. This doesn’t even include testing inputs and outputs, and validation of the results.

CONTINUE READING