Create homogenity.R

From: https://gist.github.com/anonymous/1212076