R Language Code for Toby Segaran's book "Programming Collective Intelligence"