title: Changing attribute in R not possible because of levels
body: <p>I am trying to change the name of an attribute in my spatial dataset. It is supposed to be an easy alteration, but for some reason it gives me an error message stating 'invalid factor level'. When I select the attribute it returns the correct name besides the message 415 levels. It confuses me what this means but I assume I can change this attribute name in an easy way. Help is much appreciated! </p>
  
  <pre><code>mun_neth$GM_NAAM[406]
  </code></pre>
  
  <p>[1] SÃºdwest-FryslÃ¢n
  415 Levels: 's-Gravenhage 's-Hertogenbosch Aa en Hunze Aalburg Aalsmeer Aalten ... Zwolle</p>
  
  <pre><code>mun_neth$GM_NAAM[406] &lt;- 'test'
  </code></pre>
  
  <p>Warning message:
  In <code>[&lt;-.factor</code>(<code>*tmp*</code>, 406, value = c(20L, 28L, 32L, 332L, 80L,  :
    invalid factor level, NA generated</p>