title: R - convert from categorical to numeric for KNN
body: <p>I'm trying to use the Caret package of R to use the KNN applied to the "abalone" database from UCI Machine Learning (link to the <a href="http://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data" rel="nofollow">data</a>). But it doesn't allow to use KNN when there's categorical values.
  How do I convert the categorical values (in this database: <code>"M","F","I"</code>) to numeric values, such as <code>1,2,3</code>, respectively?</p>