From http://www.dataapple.net/wp-content/uploads/2013/12/RFM_Analysis_R_Source_Codes_V1.3.txt