R code for fraud detection