R code: reading, preprocessing and counting text.