title: Category of variable didn't change in R
body: <p>I want rename a category in a variable as shown here
  <a href="https://stackoverflow.com/questions/5824173/replace-a-value-in-a-data-frame-based-on-a-conditional-if-statement">Replace a value in a data frame based on a conditional (`if`) statement</a></p>
  
  <p>The values of <code>itog$GOODS_NAME</code> are:</p>
  
  <pre><code>МАКФА макар УЛИТКИ 450г
  </code></pre>
  
  <p>When I change one of them like this:</p>
  
  <pre><code>itog$GOODS_NAME[itog$GOODS_NAME == "макар"] &lt;- "макароны"
  </code></pre>
  
  <p>The values of <code>itog$GOODS_NAME</code> should be:</p>
  
  <pre><code>МАКФА макароны УЛИТКИ 450г`
  </code></pre>
  
  <p>But instead they are unchanged:</p>
  
  <pre><code>itog$GOODS_NAME
  
  МАКФА макар УЛИТКИ 450г
  </code></pre>