Blog Archives

Be assertive!

May 30, 2012
By
Be assertive!

assertive, my new package for writing robust code, is now on CRAN. It consists of lots of is functions for checking variables, and corresponding assert functions that throw an error if the condition doesn’t hold. For example, is_a_number checks that the input is numeric and scalar. In the last two cases, the return value of

Read more »

Benford’s Law and fraud in the Russian election

March 5, 2012
By
Benford’s Law and fraud in the Russian election

Earlier today Ben Goldacre posted about using Benford’s Law to try and detect fraud in the Russian elections. Read that now, or the rest of this post won’t make sense. This is a loose R translation of Ben’s Stata code. The data is held in a Google doc. While it is possible to directly retrieve

Read more »

GUI building in R: gWidgets vs Deducer

February 20, 2012
By
GUI building in R: gWidgets vs Deducer

I’ve been a user (and fan) of gWidgets for a couple of years now for GUI building in R. (See my introduction to it here.) However, it’s always good to check out the competition so I’ve been playing around with Deducer to see how they compare. R can access a number of GUI building frameworks

Read more »

R hits 10000 questions on stackoverflow

February 17, 2012
By
R hits 10000 questions on stackoverflow

A milestone, though not that exciting as questions go. Still, if you haven’t yet joined the cult of Stack Exchange, take a look here. Tagged: r, stackoverflow

Read more »

Exploring the functions in a package

January 26, 2012
By
Exploring the functions in a package

Sometimes it can be useful to list all the functions inside a package. This is done in the same way that you would list variables in your workspace. That is, using ls. The syntax is ls(pos = "package:packagename"), which is easy enough if you can remember it. Unfortunately, I never can, and have to type

Read more »

A quick primer on split-apply-combine problems

December 16, 2011
By
A quick primer on split-apply-combine problems

I’ve just answered my hundred billionth question on Stack Overflow that goes something like I want to calculate some statistic for lots of different groups. Although these questions provide a steady stream of easy points, its such a common and basic data analysis concept that I thought it would be useful to have a document

Read more »

Interactive graphics for data analysis

September 1, 2011
By
Interactive graphics for data analysis

I got a copy of Martin Theus and Simon Urbanek’s Interactive Graphics for Data Analysis a couple of years ago, whence it’s been sat on my bookshelf. Since I’ve recently become a self-proclaimed expert on interactive graphics I thought it was about time I read the thing. Which is exactly what I did last weekend

Read more »

Nomograms everywhere!

August 30, 2011
By
Nomograms everywhere!

At useR!, Jonty Rougier talked about nomograms, a once popular visualisation that has fallen by the wayside with the rise of computers. I’d seen a few before, but hadn’t understood how they worked or why you’d want to use them. Anyway, since that talk I’ve been digging around in biology books from the 60s and

Read more »

Anonymising data

August 23, 2011
By
Anonymising data

There are only three known jokes about statistics in the whole universe, so to complete the trilogy (see here and here for the other two), listen up: Three statisticians are on a train journey to a conference, and they get chatting to three epidemiologists who are also going to the same place. The epidemiologists are

Read more »