XHMM R scripts