GavHack R code