How to classify text in R

Code source from the article SVM Tutorial: How to classify text in R