title: R remove repetitive strings
body: <p>I want to remove repetitve strings in R.
  I simplified my situation and tried two things.</p>
  
  <pre><code>#1 remove a vector
  x=c("a","a","b","c","d")
  x[-(x=="a")] 
  </code></pre>
  
  <p>I expected it would remove all "a"s but the result is</p>
  
  <pre><code>[1] "a" "b" "c"
  </code></pre>
  
  <p>Secondly, I tried "NULL"</p>
  
  <pre><code>x[x=="a"]=NULL
  </code></pre>
  
  <p>But there was an error :</p>
  
  <pre><code>Error in x[x == "a"] = NULL : replacement   has length zero
  </code></pre>
  
  <p>How can I remove repetitve strings? In this situation, removing all "a"s and print </p>
  
  <pre><code>[1] "b" "c" "d"
  </code></pre>
  
  <p>?</p>