Karl Broman's R code