R code for a kaggle competition.