Tag Archives: R

The mysterious case of the misbehaving writeLines() (or: a cat saves the day)

Dear readers and R experts, I submit to you a mysterious R quirk which has been baffling me for the best part of a week. I found a work-around but I’d love it if someone could explain this strangest of … Continue reading

Posted in Uncategorized | Tagged , , , , | 2 Comments

Anarchy Golf! And that’s your Sunday gone.

I like to follow good practice when I program. I want my code to be readable, properly indented, modular and re-usable. And I want my variables to have descriptive names. There’s nothing that I hate moderately dislike more than arbitrary … Continue reading

Posted in Uncategorized | Tagged , , , | 8 Comments

plyr, ggplot2 and triathlon results, part II

I ended my previous post by mentioning how one could imagine other ways of looking at the triathlon data with plyr and ggplot2. I couldn’t help but carry on playing with it so here are more stats and graphs from … Continue reading

Posted in Uncategorized | Tagged , , , , | 2 Comments

An exercise in plyr and ggplot2 using triathlon results

I ran my last triathlon for this year a couple of weeks ago, in the beautiful town of Stratford-upon-Avon. The results were online the day after so I decided to have a look at my fellow competitors’ times, which gave … Continue reading

Posted in Uncategorized | Tagged , , , , , | 3 Comments

A first go at ‘manipulate’ in RStudio

Something I’m missing from R (especially coming from Mathematica) is the ability to quickly build interactive graphs, which I find very useful for getting a good intuition of the impact of parameters on a mathematical function. Richie Cotton’s post about … Continue reading

Posted in Uncategorized | Tagged , , , , | 4 Comments

Two Castles Run 2011

I did the Two Castles Run today; it’s a 10km race between Warwick and Kenilworth castles. The organizers were very quick to put the results online and even went the extra mile of offering them as a CSV file. It … Continue reading

Posted in Uncategorized | Tagged , , | 4 Comments

An unsurprising year

I’ve received one those FW:…:FW emails yesterday with the following text: 2011 is an unusual year. Add the last two digits of your birth year to the age you will turn on your birthday this year and you’ll get 111! … Continue reading

Posted in Uncategorized | Tagged , , | 2 Comments

Graph Bisection in R

Recently I had to partition a set of SNPs into a training set and a test set. Making a random split would not do: both sets would likely contain very similar SNPs due to linkage disequilibrium (LD), making them non-independent. … Continue reading

Posted in Uncategorized | Tagged , , , , | Comments Off on Graph Bisection in R

Block diagonal matrices in R

As far as I can tell, R doesn’t have a function for building block diagonal matrices so as I needed one, I’ve coded it myself. It might save someone some time. Example: Let m1 and m2 two square matrices. Select … Continue reading

Posted in Uncategorized | Tagged , | 2 Comments