Super easy heatmaps of postcodes

Whatever I want to do, there are always intrepid explorers who’ve been there and blogged it, and so the satisfaction of my long held desire to get to know more about how Nottinghamshire Healthcare’s services are spread geographically has been wonderfully expedited by these amazing blog posts. Special thanks, of course, go to David Kahle and Hadley Wickham, progenitors of the mighty ggmap package and also to the fine folk at geonames who freely distribute postcodes from around the world in .

Easy tables for publication

I’m writing for a journal article today and it’s the familiar problem of how to export all of the beautiful tables and graphs from LaTeX to Word (using R, of course). It’s surprisingly easy to get a table from R into Word (or Open Office, or…). Just export the table to a text file and use tab-delimiting: <pre class="brush: r; title: ; notranslate" title=""> write.table(mytable1, "Summary.txt", sep="t") Then simply copy the table into the file, select “Convert text to table”, make sure “tab-delimiting” is selected, which it probably is, and voila.

A joke about R

I’m so sorry, I’ve come across an R joke I must share. If you don’t care about R, look away now because this post is definitely not for you. A scientist and a statistician are working together in the office. The scientist says to the statistician “Which is the fastest way to identify non-zero elements in an array using R?”. The statistician replies “Yes.” “No, which is the fastest way?”

R-Uni (A List of Free R Tutorials and Resources in University webpages)

List of R tutorials for beginners.

Great analogue visualisation

Perhaps another chapter in the infographics versus data graphics debate, a truly eye-catching visualisation of sugar contents in different drinks. Rethink Your Drink!.

Parallelising with R

I’ve been fitting some generalised linear mixed effects models with 400,000 rows or so and it takes a while even on my quad core 3.4Ghz behemoth. The time has come for me to learn how to use multiple cores with R. The parallel library which comes with the new-ish R 2.14 makes it pretty easy. For my purposes, all I needed to do was pop all of my calculations in a list and then call mclapply on them.

Quick R tip- making scripts work across OS&#8217;s

Quick thought for newbies to R. I have spent four years loading in data like this <pre class="brush: r; title: ; notranslate" title=""> mydatafirst=read.csv("D:\Dropbox\R-files\Project1\etc.") on my Windows machine and like this <pre class="brush: r; title: ; notranslate" title=""> mydatafirst=read.csv("/home/chris/Dropbox/R-files/Project1/etc.") on my Linux machine. I would comment out the one I wasn’t using at the time. It’s fine for a while but once you start reading multiple dataframes (particularly if they’re not all loaded at the start) it gets very fiddly and annoying.

Dr John Milton &#8211; Your days are numbered: Measuring clinical performance in mental health

Excellent post re: Moneyball and a clinician’s perspective.

Excellent post about R base graphics

If you’re a keen user of the base graphics functionality in R (and you should be) then you’ll love this excellent summary of some of the useful and esoteric options within: Click!

Because it&#8217;s Friday- animated graphs

I’ve been analysing some data and we’re a bit unsure, as we often are, as to its quality. We have a variety of clinicians rating C.tot and R.tot over a four year period for a set of patients. To summarise, there was some concern that people are rating C.tot consistently and well but not so with R.tot (I’m not going to explain the variables or where they come from because it’s not relevant and it’s an internal dataset we’re not ready to share yet).