Meet Björn

Photographs of a friend’s cat named Björn. Björn is a fluffy Norwegian forest cat.

This is Björn. He is a 6 month old Norwegian Forest Cat. Björn is energetic and playful. He is very fluffy and cuddly. He likes human company. He is one those strange cats that like belly rubs. His sleeping spot is the hammock on the play tower. But he can also be naughty around the house. Sometimes, he does go hyper and runs around the house. He attacks toilet paper rolls like there is no tomorrow. Sometimes he can be stupid enough to fall out through the window. Other times, he can be sharp enough to spot a fly on the window from meters away. He likes to help with the gardening. He also likes to help with things when not needed. But, he is generally good company to have around the house.

A guide to elegant tiled heatmaps in R

A step-by-step guide to data preparation and plotting of simple, neat and elegant heatmaps in R using base graphics and ggplot2.

This was inspired by the disease incidence rate in the US featured on the Wall Street Journal which I mentioned in one of the previous posts. The disease incidence dataset was originally used in this article in the New England Journal of Medicine. Here, I use the measles level 1 incidence (cases per 100,000 people) dataset obtained as a .csv file from Project Tycho. Download the .csv file here or head over to Project Tycho for other datasets.

In this post, we will look into creating a neat, clean and elegant heatmap in R. No clustering, no dendrograms, no trace  lines, no bullshit. We will go through some basic data cleanup, reformatting and finally plotting. We go through this step by step. For the whole code with minimal explanations, scroll to the bottom of the page.

Read More