20130701: add the R code to compare