title: R - create a categorical variable out of numeric
body: <p>I have a data.frame which consists of 12 columns. None of them are categorical variables. However, I want to create one categorical variable out of the first columns (prices in my case) and the split up the data into these 4 categories.</p>
  
  <p>I started out by transforming the csvfile into a data.frame</p>
  
  <p>Next I started ordering the numbers after that one column (I want the categorical variable to be split into "low", "Medium", "high", "very high")</p>
  
  <pre><code>new &lt;- old[order(old$price),]
  </code></pre>
  
  <p>Next I used the function Cut to cut this one column into 4 intervals. </p>
  
  <pre><code>prices.new &lt;- cut(new$price, breaks=4, labels=c("low","medium","high","very high"))
  </code></pre>
  
  <p>Now I want to replace the column old$price by prices.new. </p>
  
  <pre><code>new1 &lt;- new[replace(new$price, prices.new)]
  </code></pre>
  
  <p>However, it always tells me that the value is missing.</p>
  
  <p>I also see a problem because I don't know if the other values will still be comparable after that. ( I want to compare these intervals then with each other with the ANOVA afterwards)</p>