# Blog Archives

## Shading between two lines – ggplot

June 1, 2014
By

First one to say geom_ribbon loses. I was plotting some data for a colleague, had two lines (repeated experiment) per person (time on the x axis) facetted by id, I thought it’d be nice to shade the area between the … Continue reading →

## Finding the midpoint when creating intervals

May 23, 2014
By

Nothing ground breaking here. I was doing some work dividing data into deciles and then creating some plots. I couldn’t find an function to calculate this from cut, and I use cut quite a bit. So here we are. midpoints … Continue reading →

## ggplot + powerpoint = wall + head … solution?

September 2, 2013
By

Confession, by ‘solution?’ I literally mean I’m asking for your thoughts on a solution. Like it or lump it I do a lot of graphs for presentations, largely in powerpoint. That’s the way my colleagues/industry work(s) and it’s not about … Continue reading →

## Updated age calculation function

June 12, 2013
By

I had previously posted a function for calculating age with two dates. This was for the whole number ‘age’ where we are assuming you don’t want someone to be recorded as ’18′ until their 18th birthday (so more than just … Continue reading →

## ggplot graphs in publications?

November 6, 2012
By

The grey background and/or default choice of colours for groups makes a ggplot graph stand out to any R user when seen in a presentation. But ggplot graphs get all ninja when it comes to publications, either that or not … Continue reading →

## Forest plots in R (ggplot) with side table

November 6, 2012
By

A friend asked me to help with a forest plot recently. After chatting about what she wanted the end result to look like, this is what I came up with. grid.arrange(data_table, p, ncol=2) ## Warning: Removed 1 rows containing missing … Continue reading →

## Popularity indicator, with images (NFL)

September 23, 2012
By

It’s Friday night, there’s nothing good on TV, mmm conditions are perfect for shaggin about in R. So I’m an NFL fan, and (shameless plug) avid fan of this NFL podcast. They run their own pickem league which unless users … Continue reading →

## Simple plot with text boxes

September 21, 2012
By

Was doing a little presentation to our research group and had to explain the difficulties of ‘collapsing’ longitudinal data into a single measure when the Y var is quite variable. For the particular Y var of interest, it represents burden … Continue reading →

## (Manually) making letters with geom_path() – fun example

August 15, 2012
By

Disclaimer, maybe the title should be ‘lame example’. Nothing overly exciting here. Just posting cause it took a little faffing about and someone else might like the idea. At my work (research institute) we (the social club committee) were organising … Continue reading →

## Petrol prices adjusted for inflation

July 28, 2012
By

Petrol prices adjusted for inflation (Perth, Western Australia) The thought for this sprung to mind when I saw petrol drop below \$1.20 per litre the other day, and it made me think, I remember paying that when I got to … Continue reading →